Lightweight Node.js/Express framework written in TypeScript for building secured, clustered and well-designed APIs.
The easiest way to install deadlock.js is with
npm i --save deadlockjs
Here are the main features provided by deadlock.js
- full API specification in a single object
- rate limit - delay and drop requests
- ip whitelist&blacklist for rate limit
- request caching
- mysql pool
- request body parsing, validation and filtering
- file upload
- cors handling
- https & http2 Support
- internal statistics (hits, execution time)
- internal api (retrieve stats, dynamically change route, ip blacklist/whitelist, etc)
Here is a simple working example
const DeadLock = DeadLock;const api =routes:'/': async "Hello World";DeadLock;
That's all you need to get your web server up and running!
Here is an example of a web app with custom middleware, rate limit, mysql connection, and request body validation
Each worker will allocate a MySQL Pool with 'connectionLimit' connections.