@tanshenghu/node-session
v1.0.0
Published
node服务端session
Downloads
2
Readme
@tsh/node-session
Installation
npm install @tsh/node-session --save-dev
or
yarn add @tsh/node-session --dev
desc
- 数据内存 存储集合
DEMO
import http from 'http';
import Nsession from '@tsh/node-session';
const middleware = Nsession();
http.createService(function(request, response){
middleware({
context: request,
next: Promise.resolve
});
...
...
request.setItem('userName', '张三丰');
...
...
response.end('');
})
.listen(8080);