Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/ass/commit/62b2bf953fea0b3f208d5c780f2e64290ccc0e8b You should set ROOT_URL correctly, otherwise the web may not work correctly.

feat: added initial API routers (no routes yet)

pull/180/head
tycrek 2 years ago
parent 49d1a70b27
commit 62b2bf953f
No known key found for this signature in database
GPG Key ID: FF8A54DCE404885A

@ -0,0 +1,22 @@
/**
* Developer API
* - Users
* - Resources
*/
import { Router, Request, Response, NextFunction } from 'express';
import { users } from '../auth';
import { data } from '../data';
const RouterUser = Router();
const RouterResource = Router();
/**
* Token authentication middleware
*/
const authMiddleware = (req: Request, res: Response, next: NextFunction) => {
const token = req.headers.authorization;
(token && users[token])
? next()
: res.sendStatus(401);
};
Loading…
Cancel
Save