【文件属性】:
文件名称:pure-http:Node零依赖的Node.js的简单Web框架
文件大小:123KB
文件格式:ZIP
更新时间:2021-02-03 19:52:21
javascript api http middleware node
纯HTTP
将中间件和路由器添加到本地http。
安装
$ npm install --save pure-http
用法
基本服务器:
const pureHttp = require ( 'pure-http' ) ;
const app = pureHttp ( ) ;
app . get ( '/' , ( req , res ) => {
res . send ( 'Hello world' ) ;
} ) ;
app . listen ( 3000 ) ;
现有服务器:
const http = require ( 'http' ) ;
const pureHttp =
【文件预览】:
pure-http-master
----.travis.yml(119B)
----index.js(338B)
----art()
--------cover.jpeg(95KB)
----demos()
--------https()
--------render()
--------error()
--------basic()
--------router()
----package.json(2KB)
----.eslintrc.json(750B)
----.github()
--------funding.yml(622B)
--------stale.yml(684B)
----test()
--------server.test.js(2KB)
--------sub-router.js(169B)
--------server.js(411B)
--------router.js(492B)
----.prettierrc(194B)
----LICENSE(1KB)
----index.d.ts(5KB)
----bench()
--------middlewares.js(163B)
--------index.js(1KB)
--------express.js(304B)
--------pure-http.js(301B)
--------bench.js(2KB)
--------fastify.js(428B)
--------pure-http-with-cache.js(348B)
--------polka.js(301B)
--------README.md(1KB)
----.gitignore(2KB)
----lib()
--------utils.js(2KB)
--------pure-http.js(2KB)
--------request.js(504B)
--------cache.js(1KB)
--------router.js(5KB)
--------response.js(5KB)
----README.md(4KB)
----yarn.lock(109KB)
----API.md(6KB)
----.vscode()
--------settings.json(88B)