diff options
| author | Tom Harley | 2018-02-02 16:06:30 +0000 |
|---|---|---|
| committer | Tom Harley | 2018-02-02 16:06:30 +0000 |
| commit | 4818cc8a390c68daa3b0a3d4e09c103c6c9f2dd4 (patch) | |
| tree | 1a4ec6777758f6aabf64e1b73d1997845ad9c5db | |
| parent | Added .nvmrc stipulating use of node v9.1.0 (diff) | |
| download | medicine-4818cc8a390c68daa3b0a3d4e09c103c6c9f2dd4.tar.gz medicine-4818cc8a390c68daa3b0a3d4e09c103c6c9f2dd4.zip | |
Removed compiled files from repo, and added folder to .gitignore
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | dist/FileRouter.js | 47 | ||||
| -rw-r--r-- | dist/app.js | 31 | ||||
| -rw-r--r-- | dist/index.js | 12 |
4 files changed, 3 insertions, 90 deletions
@@ -1,5 +1,8 @@ # npm module storage node_modules/ +# compiled files +dist/ + # Vim swap files *.sw* diff --git a/dist/FileRouter.js b/dist/FileRouter.js deleted file mode 100644 index adf87cc..0000000 --- a/dist/FileRouter.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const express_1 = require("express"); -const Files = null; //require('../data'); -/* - * |-> - * /project/files/directory/file?filters - * |-> - */ -class FileRouter { - /** - * Initialize the FileRouter - */ - constructor() { - this.router = express_1.Router(); - this.init(); - } - /** - * GET a File. - */ - getFile(req, res, next) { - let fileID = req.params.file; - // check if fileID is number or path - // find file in data - // check if only metadata was requested and return appropriate info - // otherwise: - // if image: - // convert if necessary - // zoom if necessary - // if csv/xls - // send data in appropriate csv format - // limit cols if necessary - res.send("File"); - } - /** - * Take each handler, and attach to one of the Express.Router's - * endpoints. - */ - init() { - this.router.get('/:file', this.getFile); - } -} -exports.FileRouter = FileRouter; -// Create the FileRouter, and export its configured Express.Router -const fileRoutes = new FileRouter(); -fileRoutes.init(); -exports.default = fileRoutes.router; diff --git a/dist/app.js b/dist/app.js deleted file mode 100644 index 5d7bc52..0000000 --- a/dist/app.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const express = require("express"); -const logger = require("morgan"); -const bodyParser = require("body-parser"); -const FileRouter_1 = require("./FileRouter"); -class App { - constructor() { - this.express = express(); - this.middleware(); - this.mountRoutes(); - } - // Configure Express middleware. - middleware() { - this.express.use(logger('combined')); - this.express.use(bodyParser.json()); - this.express.use(bodyParser.urlencoded({ extended: false })); - } - // Configure API endpoints. - mountRoutes() { - const defRouter = express.Router(); - defRouter.get('/', (req, res) => { - res.json({ - message: 'Welcome to the CS3099 BE4 server!' - }); - }); - this.express.use('/', defRouter); - this.express.use('/cs3099group-be-4/files/directory', FileRouter_1.default); - } -} -exports.default = new App().express; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index 7628251..0000000 --- a/dist/index.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -console.log('Welcome to the CS3099 Server thingy!'); -const app_1 = require("./app"); -// use default port 3000 or port supplied by OS -const port = process.env.PORT || 3000; -app_1.default.listen(port, (err) => { - if (err) { - return console.log(err); - } - return console.log(`server is listening on port ${port}`); -}); |
