This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --location 'https://localhost:7160/api/email/send' \ | |
--header 'Content-Type: application/json' \ | |
--header 'X-Api-Key: 9yIQbmgbCdhpNDPcc3wutN2hH7cK==' \ | |
--data-raw '{ | |
"from": { | |
"email": "[email protected]", | |
"name": "Your App Name" | |
}, | |
"to": { | |
"email": "[email protected]", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a service container with Elsa services. | |
var services = new ServiceCollection() | |
.AddElsa() | |
// For production use. | |
.UseYesSqlPersistence() | |
// Or use any of the other supported persistence providers such as EF Core or MongoDB: | |
// .UseEntityFrameworkPersistence(ef => ef.UseSqlite()) | |
// .UseMongoDbPersistence() | |
.BuildServiceProvider(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const { expressServer } = require('./server'); | |
const moleculerApi = functions.https.onRequest(expressServer); | |
module.exports = { | |
moleculerApi | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ServiceBroker } = require("moleculer"); | |
const express = require('express'); | |
const config = require('./moleculer.config'); | |
const { PORT, NODE_ENV } = process.env; | |
const dev = NODE_ENV === 'development'; | |
const broker = new ServiceBroker(config); | |
broker.loadServices("./services"); | |
const svc = broker.getLocalService("api"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"projects": { | |
"default": "moleculer-firebase" | |
}, | |
"targets": { | |
"moleculer-firebase": { | |
"hosting": { | |
"api": [ | |
"moleculer-firebase" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hosting": [ | |
{ | |
"target": "api", | |
"public": "functions/public", | |
"ignore": [ | |
"firebase.json", | |
"**/.*", | |
"**/node_modules/**" | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "functions", | |
"version": "1.0.0", | |
"description": "My Moleculer-based microservices project", | |
"scripts": { | |
"dev": "moleculer-runner --repl --hot services/**/*.service.js", | |
"start": "moleculer-runner", | |
"cli": "moleculer connect ", | |
"ci": "jest --watch", | |
"test": "jest --coverage", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Python: Current File (Integrated Terminal)", | |
"type": "python", | |
"request": "launch", | |
"program": "${file}", | |
"console": "integratedTerminal" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ApiGateway = require("moleculer-web"); | |
module.exports = { | |
name: "api", | |
mixins: [ApiGateway], | |
settings: { | |
port: process.env.PORT || 3000, | |
routes: [{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// articles.service.js | |
module.exports = { | |
name: "articles", | |
actions: { | |
list: { | |
handler(ctx) { | |
return "GET articles list"; | |
} | |
}, |
NewerOlder