mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-21 16:52:03 -07:00
Add session support
This commit is contained in:
+6
-2
@@ -4,8 +4,12 @@ const config = {
|
||||
common: {
|
||||
port: process.env.PORT || 5000
|
||||
},
|
||||
development: {},
|
||||
production: {}
|
||||
development: {
|
||||
session: 'secret-boilerplate-token'
|
||||
},
|
||||
production: {
|
||||
session: 'secret-boilerplate-token'
|
||||
}
|
||||
}
|
||||
|
||||
export default Object.assign({}, config.common, config[env])
|
||||
|
||||
+4
-1
@@ -2,15 +2,18 @@ import Koa from 'koa'
|
||||
import bodyParser from 'koa-bodyparser'
|
||||
import convert from 'koa-convert'
|
||||
import logger from 'koa-logger'
|
||||
import session from 'koa-generic-session'
|
||||
|
||||
import config from './config'
|
||||
import { errorMiddleware } from '../src/utils'
|
||||
|
||||
const app = new Koa()
|
||||
app.keys = [config.session]
|
||||
|
||||
app.use(convert(logger()))
|
||||
app.use(errorMiddleware())
|
||||
app.use(convert(bodyParser()))
|
||||
app.use(convert(session()))
|
||||
app.use(errorMiddleware())
|
||||
|
||||
const router = require('../src/controllers')
|
||||
router(app)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"koa": "^2.0.0-alpha.3",
|
||||
"koa-bodyparser": "^2.0.1",
|
||||
"koa-convert": "^1.2.0",
|
||||
"koa-generic-session": "^1.10.1",
|
||||
"koa-logger": "^1.3.0",
|
||||
"koa-router": "^7.0.1"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user