jap-express
npm | github
This is a plugin for express to jap your app.
Install with npm
npm i jap-express
Install with yarn
yarn add jap-express
Arguments
japExpress(
handler: object | Jap
,
resolve?: (data: json) => json
,
reject?: (data: json, error: Error, handler) => json
,
start?: (req, res) => void
,
end?: (req, res) => void
,
context?: any
)
Simple example
- Add file
index.js
const express = const jap = const app = appappapp
- Run the app
node index.js
- Open browser with
http://localhost:3000/
and run the next code in console
Jap
You may use Jap
, this is a good way to have separately space for each request
- Add
classic.js
const express = const jap Jap = const app = { return this$reqheaders'user-agent' } appappapp
- Run the app
node classic.js
- Open browser with
http://localhost:3001/
and run the next code in console
Real example
You may look at real example with jap:
git clone https://github.com/d8corp/jap.gitcd japnpm inpm start