add simple version route

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-01-17 15:46:42 -08:00
parent ae0c197821
commit 8e1bf19d90
2 changed files with 22 additions and 0 deletions

21
index.js Normal file
View File

@ -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');
});

View File

@ -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",