diff --git a/index.js b/index.js new file mode 100644 index 0000000..8d3e97d --- /dev/null +++ b/index.js @@ -0,0 +1,21 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const cors = require('cors'); +const helmet = require('helmet'); +const morgan = require('morgan'); +var package = require('./package.json'); + +const app = express(); +app.use(helmet()); +app.use(bodyParser.json()); +app.use(cors()); +app.use(morgan('combined')); + + +app.get('/api/version', (req, res) => { + res.send({version: package.version}); +}); + +app.listen(80, () => { + console.log('listening on port 80'); +}); \ No newline at end of file diff --git a/package.json b/package.json index 32e9526..1fbada2 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "proxmoxaas-api", "version": "0.0.1", "description": "REST API for ProxmoxAAS", + "main": "index.js", "dependencies": { "body-parser": "^1.20.1", "cors": "^2.8.5",