diff --git a/README.md b/README.md index e916d37..5dcdab3 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,15 @@ Whilst the application is open source, the webservice (owlboard.fb-infra.uk) is - GET: Get list of stations - Returns JSON: `{"STATION NAME":{"CRS":"code","TIPLOC":"code"}}` - - /ldb: \ No newline at end of file + - /ldb: + +## Stack: + - app.js -> Launches server, Entry Point, defines routers and middlewares. + - routes -> Routers - Directs requests to controllers. + - controllers -> Checks auth, sends response. Request doesn't pass further. + - services -> Provide data and do tasks, uses other services and utils. + + - utils -> Provide utility functions that can be called by services. + - configs -> Provide configuration details for other files. + - static -> Holds files for static service, should be hosted behind a caching proxy. + \ No newline at end of file diff --git a/src/controllers/test.controllers.js b/src/controllers/test.controllers.js index 1d2f48f..dcee6c5 100644 --- a/src/controllers/test.controllers.js +++ b/src/controllers/test.controllers.js @@ -10,6 +10,7 @@ async function get(req, res, next){ } async function post(req, res){ + // try { checkAuth(req.body) } catch (err) { req.header(401); req.body({401:"unauthorised"})} try { res.json(await test.post(req.body)) } catch (err) {