diff --git a/app.js b/app.js index 6292e11..5978db0 100644 --- a/app.js +++ b/app.js @@ -3,14 +3,14 @@ // Please see the included LICENSE file // Version Number: -var version = "0.0.1" +var version = "0.0.1" console.log(`Starting OwlBoard version ${version}`) // Load Modules: -const fs = require('fs'); -const ldb = require('ldbs-json'); -const express = require('express'); -const app = express(); +const fs = require('fs'); +const ldb = require('ldbs-json'); +const express = require('express'); +const app = express(); // Get API Keys: try { @@ -32,7 +32,8 @@ try { }; // Create Web Service: -app.use(express.json()); +app.use(express.json()); //JSON Parsing for POST Requests +app.use(express.static('static')); //Serve static content from static app.listen(settings.webPort, (error) =>{ if(!error) @@ -47,20 +48,20 @@ app.listen(settings.webPort, (error) =>{ // Routes: -app.get('/', (req, res)=>{ +app.get('/api', (req, res)=>{ res.status(200); res.set('Content-Type', 'application/json'); res.send(JSON.stringify({"OwlBoard_Status":"ready","OwlBoard_Version":version})); }); -app.post('/test', (req, res)=>{ +app.post('/api/test', (req, res)=>{ const {test} = req.body; res.status(200); res.set('Content-Type', 'application/json'); res.send(JSON.stringify({"test_outcome":"success","post_value":test})) }) -app.post('/arrdep', (req, res)=>{ +app.post('/api/arrdep', (req, res)=>{ //Check Validity and Auth then return ArrDep JSON const {reqCode} = req.body; const {auth} = req.body; diff --git a/http.js b/old-files/http.js similarity index 100% rename from http.js rename to old-files/http.js diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..917cbd8 --- /dev/null +++ b/static/index.html @@ -0,0 +1,9 @@ + + + + OwlBoard + + +

OwlBoard

+ + \ No newline at end of file