1.0.0 • Published 4 years ago
swiftpress v1.0.0
Swiftpress
This is a npm package that helps you create express.js apps faster using much less code. It is built directly on top of express and provides all express functionalities.\
npm install swiftpressDependencies
body-parser: ^1.20.0\ cors: ^2.8.5\ express: ^4.17.3\
Defaults
It uses body-parser by default to automatically get request body. It also implements global cors by default allowing you to request from any web page.
Main Constructor
SwiftServer(
port: int = 3000
cors: string = "*"
)#Initiate const SwiftServer = require('swiftpress');
const app = new SwiftServer(9999, "*");Requests
app.req (
callback: function(req, res)
path: string = /
method: string = GET (GET || POST || PUT || DELETE || PATCH || HEAD || OPTIONS)
)Run
app.run((port) => { callback })1.0.0
4 years ago