How to use io-functions-express - 3 common examples

To help you get started, we’ve selected a few io-functions-express examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github teamdigitale / io-functions / lib / public_api_v1.ts View on Github external
blobService
  )
);

app.get(
  "/api/v1/messages/:fiscalcode",
  GetMessages(serviceModel, messageModel)
);
app.post(
  "/api/v1/messages/:fiscalcode",
  CreateMessage(getCustomTelemetryClient, serviceModel, messageModel)
);

app.get("/api/v1/info", GetInfo(serviceModel));

const azureFunctionHandler = createAzureFunctionHandler(app);

// Binds the express app to an Azure Function handler
export function index(context: Context): void {
  const logLevel = isProduction ? "info" : "debug";
  configureAzureContextTransport(context, winston, logLevel);
  setAppContext(app, context);
  azureFunctionHandler(context);
}
github teamdigitale / io-functions / lib / openapi.ts View on Github external
import { GetOpenapi } from "./controllers/openapi";

import { specs as adminApiSpecs } from "./api/admin_api";
import { specs as publicApiV1Specs } from "./api/public_api_v1";

// Whether we're in a production environment
const isProduction = process.env.NODE_ENV === "production";

// Setup Express

const app = express();

app.get("/specs/api/v1/swagger.json", GetOpenapi(publicApiV1Specs));
app.get("/specs/adm/swagger.json", GetOpenapi(adminApiSpecs));

const azureFunctionHandler = createAzureFunctionHandler(app);

// Binds the express app to an Azure Function handler
export function index(context: Context): void {
  const logLevel = isProduction ? "info" : "debug";
  configureAzureContextTransport(context, winston, logLevel);
  setAppContext(app, context);
  azureFunctionHandler(context);
}
github teamdigitale / io-functions / lib / admin_api.ts View on Github external
masterKey: cosmosDbKey
});

const serviceModel = new ServiceModel(documentClient, servicesCollectionUrl);

// Setup handlers

const debugHandler = GetDebug(serviceModel);
app.get("/adm/debug", debugHandler);
app.post("/adm/debug", debugHandler);

app.get("/adm/services/:serviceid", GetService(serviceModel));
app.post("/adm/services", CreateService(serviceModel));
app.put("/adm/services/:serviceid", UpdateService(serviceModel));

const azureFunctionHandler = createAzureFunctionHandler(app);

// Binds the express app to an Azure Function handler
export function index(context: Context): void {
  const logLevel = isProduction ? "info" : "debug";
  configureAzureContextTransport(context, winston, logLevel);
  setAppContext(app, context);
  azureFunctionHandler(context);
}

io-functions-express

Express adapter for Azure Functions

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Popular io-functions-express functions

Similar packages