rename index.js to main.js
remove unused imports in main.js, add function prototypes to db.js
This commit is contained in:
parent
62eca6c427
commit
c9595980cd
20
db.js
Normal file
20
db.js
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* called at app startup, can be used to initialize any variables needed for database access
|
||||
*/
|
||||
function init () {}
|
||||
|
||||
/**
|
||||
* user requests additional resources specified in k-v pairs
|
||||
* @param {string} user user's proxmox username in the form username@authrealm
|
||||
* @param {Object} resources k-v pairs with resource name as keys and resource ammount as values
|
||||
*/
|
||||
function requestResources (user, resources) {}
|
||||
|
||||
/**
|
||||
* user releases allocated resources specified in k-v pairs
|
||||
* @param {string} user user's proxmox username in the form username@authrealm
|
||||
* @param {Object} resources k-v pairs with resource name as keys and resource ammount as values
|
||||
*/
|
||||
function releaseResources (user, resources) {}
|
||||
|
||||
module.exports = {init, requestResources, releaseResources};
|
@ -8,8 +8,7 @@ const axios = require('axios');
|
||||
var api = require("./package.json");
|
||||
|
||||
const {pveAPI, pveAPIToken, listenPort} = require("./vars.js");
|
||||
const { token } = require("morgan");
|
||||
const { response } = require("express");
|
||||
const {init, requestResources, releaseResources} = require("./db.js");
|
||||
|
||||
const app = express();
|
||||
app.use(helmet());
|
@ -2,7 +2,7 @@
|
||||
"name": "proxmoxaas-api",
|
||||
"version": "0.0.1",
|
||||
"description": "REST API for ProxmoxAAS",
|
||||
"main": "index.js",
|
||||
"main": "main.js",
|
||||
"dependencies": {
|
||||
"axios": "^1.3.2",
|
||||
"body-parser": "^1.20.1",
|
||||
|
Loading…
Reference in New Issue
Block a user