
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@flyweight.cloud/openroute
Advanced tools
A lightweight router for Azure Functions with Swagger integration
A lightweight framework for building Swagger/OpenAPI serverless functions for consumption by Microsoft Power Platform and beyond.
npm i --save @flyweight.cloud/openroute
The goal is for OpenRoute to require little to no modification of your Azure handlers
import { Context, HttpRequest } from "@azure/functions"
import { get } from "@flyweight.cloud/request";
import Swaggerist, { schemaBuilder, Responses, queryParamBuilder, pathParamBuilder } from "@flyweight.cloud/swaggerist";
import { OpenRoute } from "@flyweight.cloud/openroute"
import { HttpError } from "@flyweight.cloud/openroute/lib/errors";
const API_KEY = process.env.OPENWEATHER_API_KEY;
const exampleWeatherApiResponse = {
"coord": {
"lon": -122.08,
"lat": 37.39
},
"weather": [
{
"id": 800,
"main": "Clear",
"description": "clear sky",
"icon": "01d"
}
],
"base": "stations"
};
const swaggerBuilder = Swaggerist.create({
info: {
title: "Weather API",
description: "Flyweights demo weather API",
version: "1.0.0",
}
})
const app = new OpenRoute({
swaggerBuilder,
cors: {
allowOrigin: "*",
allowHeaders: ["*"],
allowMethods: ["*"],
}
});
const getCurrentWeatherPathRoute = swaggerBuilder.get("/current/{zipCode}", {
operationId: "getCurrentWeatherByZip",
parameters: [...pathParamBuilder({zipCode: "12345"})],
responses: {
200: Responses.Success(schemaBuilder(exampleWeatherApiResponse)),
}
})
app.route(getCurrentWeatherPathRoute, async (context: Context, req: HttpRequest, openRoute: OpenRoute): Promise<void> => {
context.log("HTTP trigger function processed a request.");
const zipCode = context.bindingData.zipCode
let url = `https://api.openweathermap.org/data/2.5/weather?zip=${zipCode}&appid=${API_KEY}`
const weather = await get(url)
context.res = {
body: weather.body,
headers: openRoute.defaultHeaders(),
};
});
export default app.getHttpTrigger();
You will also need to modify function.json to add a 'catch-all' route
"route": "weather/{*route}"
Check out DemoFunc to see the full featured function and it's settings.
FAQs
A lightweight router for Azure Functions with Swagger integration
We found that @flyweight.cloud/openroute demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.