Skip to content

Instantly share code, notes, and snippets.

View rzvdaniel's full-sized avatar

Razvan Predescu rzvdaniel

View GitHub Profile
@rzvdaniel
rzvdaniel / gist:e2a14f24e1e7b683ecdc44e5a2f0ee08
Created January 31, 2024 10:02
Giraffegram - Send Email Example 01
curl --location 'https://localhost:7160/api/email/send' \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: 9yIQbmgbCdhpNDPcc3wutN2hH7cK==' \
--data-raw '{
"from": {
"email": "noreply@yourdomain.com",
"name": "Your App Name"
},
"to": {
"email": "tomjones@email.com",
@rzvdaniel
rzvdaniel / ElsaWorkflowsDeclarative.cs
Last active February 21, 2021 00:20
Elsa Workflows Declarative Example
// 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();
@rzvdaniel
rzvdaniel / index.js
Last active May 27, 2020 21:39
Moleculer-Firebase index.js
const functions = require('firebase-functions');
const { expressServer } = require('./server');
const moleculerApi = functions.https.onRequest(expressServer);
module.exports = {
moleculerApi
};
@rzvdaniel
rzvdaniel / server.js
Created May 27, 2020 18:36
Moleculer-Firebase server.js
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");
@rzvdaniel
rzvdaniel / .firebaserc
Created May 27, 2020 18:26
Moleculer-Firebase rc
{
"projects": {
"default": "moleculer-firebase"
},
"targets": {
"moleculer-firebase": {
"hosting": {
"api": [
"moleculer-firebase"
]
@rzvdaniel
rzvdaniel / firebase.json
Last active May 27, 2020 21:36
Moleculer-Firebase json configuration
{
"hosting": [
{
"target": "api",
"public": "functions/public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
@rzvdaniel
rzvdaniel / package.json
Last active November 6, 2020 15:38
Moleculer-Firebase package.json
{
"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",
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
@rzvdaniel
rzvdaniel / api.service.js
Created July 6, 2019 19:25
[Medium] Moleculer Routing - Shorthand RESTful Aliases
const ApiGateway = require("moleculer-web");
module.exports = {
name: "api",
mixins: [ApiGateway],
settings: {
port: process.env.PORT || 3000,
routes: [{
@rzvdaniel
rzvdaniel / articles.service.js
Created July 6, 2019 17:50
[Medium] Moleculer Routing - RESTful Aliases
// articles.service.js
module.exports = {
name: "articles",
actions: {
list: {
handler(ctx) {
return "GET articles list";
}
},