Prepare for LDBSV
This commit is contained in:
parent
aab3e00eac
commit
43fd6db4b9
@ -1,4 +0,0 @@
|
||||
# What to do next:
|
||||
|
||||
* Rewrite sanitizing functions to remove external dependancy.
|
||||
* Change /api/v1/auth endpoints to /api/v1/register endpoints - auth is done in middleware
|
12
app.js
12
app.js
@ -4,8 +4,6 @@
|
||||
// licensed separately, each folder contains a license file where a
|
||||
// different license applies.
|
||||
|
||||
/* global process */
|
||||
|
||||
console.log('Initialising OwlBoard');
|
||||
const mode = process.env.NODE_ENV || 'development';
|
||||
|
||||
@ -23,6 +21,7 @@ const log = require('./src/utils/log.utils');
|
||||
const version = require('./src/configs/version.configs');
|
||||
const listRtr = require('./src/routes/list.routes');
|
||||
const ldbRtr = require('./src/routes/ldb.routes');
|
||||
const ldbsRtr = require('./src/routes/ldbs.routes');
|
||||
const kubeRtr = require('./src/routes/kube.routes');
|
||||
const findRtr = require('./src/routes/find.routes');
|
||||
const issueRtr = require('./src/routes/issue.routes');
|
||||
@ -79,10 +78,13 @@ app.use('/api/v1/stats', statRtr);
|
||||
app.use('/api/v1/register', regRtr);
|
||||
|
||||
// Authented Routes
|
||||
app.use('/api/v1/ldbs', authenticate, (req, res) => res.status(501).json({status: 'not implemented'}));
|
||||
app.use('/api/v1/ldbs', authenticate, ldbsRtr);
|
||||
app.use('/api/v1/pis', authenticate, pisRtr);
|
||||
app.use('/api/v1/auth/test', authenticate, (req, res) => res.status(200).json({status: 'ok', message: 'Authentication successful'})); // Returns 401 if auth failed, 200 if successful.
|
||||
app.use('/api/v1/train', /*authenticate,*/ trainRtr); // Disable authentication during testing
|
||||
app.use('/api/v1/auth/test', authenticate, (req, res) => res.status(200).json({
|
||||
status: 'ok',
|
||||
message: 'Authentication successful'
|
||||
})); // Returns 401 if auth failed, 200 if successful.
|
||||
app.use('/api/v1/train', authenticate, trainRtr);
|
||||
|
||||
// Number of proxies:
|
||||
app.set('trust proxy', 4);
|
||||
|
Loading…
Reference in New Issue
Block a user