文件名称:mongoose-express-sessions:使用Mongoose进行Express会话存储
文件大小:11KB
文件格式:ZIP
更新时间:2024-03-13 04:40:35
JavaScript
猫鼬表达会议 猫鼬的快速会话存储 用法 const mongoose = require ( 'mongoose' ) const express = require ( 'express' ) const session = require ( 'express-session' ) const StoreSession = require ( "mongoose-express-sessions" ) ( session ) mongoose . connect ( ) app . use ( session ( { secret : 's3cr37' , cookie : { maxAge : 1000 * 60 * 60 * 24 * 7 } , store : new StoreSession ( { dbname : "MyDB" ,
【文件预览】:
mongoose-express-sessions-master
----index.js(4KB)
----package.json(754B)
----LICENSE(11KB)
----package-lock.json(23KB)
----.gitignore(2KB)
----README.md(498B)