Added preferences and serialize to repo. Stale sessions are refreshed on restart or after a period of time now.
This commit is contained in:
13
src/web/serialize.js
Normal file
13
src/web/serialize.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { stringify } from '@brillout/json-serializer/stringify';
|
||||
|
||||
export default function serializeApiResponses(req, res, next) {
|
||||
res.json = function json(obj) { // eslint-disable-line no-param-reassign
|
||||
if (!this.get('Content-Type')) {
|
||||
this.set('Content-Type', 'application/json');
|
||||
}
|
||||
|
||||
return this.send(stringify(obj));
|
||||
};
|
||||
|
||||
next();
|
||||
}
|
||||
Reference in New Issue
Block a user