SwiftFlow
Maintainable expressjs endpoints.
Install
npm i --save swiftflow
Example
// server.jsconst app = const EndpointManager = // Create a new EndpointManager, points to a directory of JS files.const endpoints = "./endpoints" // Install all JS files in "./endpoints" then listen on port 80.endpoints
// endpoints/hello.jsconst Endpoint = // Export a class that extends from the SwiftFlow Endpoint class.moduleexports = { super'/api/hello/:name' // The path this endpoint will listen to. } async { // All variables like .params and .query gets combined into a single object, "params". const name = params // The Endpoint class automatically handles returns and sends it to the client. return response: `Hi there !` }