add simple version route
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
96133f5882
commit
5a63b26620
21
index.js
Normal file
21
index.js
Normal 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');
|
||||||
|
});
|
@ -2,6 +2,7 @@
|
|||||||
"name": "proxmoxaas-api",
|
"name": "proxmoxaas-api",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "REST API for ProxmoxAAS",
|
"description": "REST API for ProxmoxAAS",
|
||||||
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.20.1",
|
"body-parser": "^1.20.1",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
Loading…
Reference in New Issue
Block a user