Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
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);
}
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);
}