This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createHash } from 'crypto' | |
import { NextApiRequest, NextApiResponse } from 'next' | |
export default (req: NextApiRequest, res: NextApiResponse): boolean => { | |
try { | |
if (!req.headers.cookie) { | |
res.status(403).json({ error: { status: 'no cookie?' } }) | |
return false | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paths = []; | |
paths.push(require('./healthcheck')); | |
paths.push(require('./users')); | |
module.exports = paths; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const middleware = require('../middlewares') | |
const controller = require('../controllers/users') | |
const paths = [ | |
{ | |
'path' : '/users/info', | |
'method' : 'get', | |
'middlewares' : [middleware.checkAuth], | |
'handlers' : controller.getUserInfo | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const middleware = require('../middlewares') | |
const controller = require('../controllers') | |
const paths = [ | |
{ | |
'path' : '/health/status', | |
'method' : 'get', | |
'middlewares' : [], | |
'handlers' : controller.processStatus | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const path = require('path'); | |
const cookieParser = require('cookie-parser'); | |
const logger = require('morgan'); | |
const cleanroutes = require('express-clean-routes'); | |
// option 1 | |
// var routes = []; | |
// routes.push(require('./routes/healthcheck')); | |
// routes.push(require('./routes/users')); |