initial blank express server for tps project
This commit is contained in:
commit
f0b1daa002
22
package.json
Normal file
22
package.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "tps",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "third party data munger",
|
||||||
|
"main": "server.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"start": "node server.js"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dotenv": "^6.2.0",
|
||||||
|
"express": "^4.16.4",
|
||||||
|
"pg": "^7.8.0",
|
||||||
|
"body-parser": "^1.17.1",
|
||||||
|
"cookie-parser": "^1.4.3",
|
||||||
|
"csvtojson": "^2.0.0",
|
||||||
|
"express-handlebars": "^3.0.0",
|
||||||
|
"multer": "^1.3.0"
|
||||||
|
}
|
||||||
|
}
|
23
server.js
Normal file
23
server.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
require('dotenv').config();
|
||||||
|
const express = require('express');
|
||||||
|
var https = require('https');
|
||||||
|
var bodyParser = require('body-parser');
|
||||||
|
const server = express();
|
||||||
|
const pg = require('pg');
|
||||||
|
|
||||||
|
//---------read sql files into variables----------------
|
||||||
|
var fs = require('fs');
|
||||||
|
var readline = require('readline');
|
||||||
|
//-------------------------------------------------------
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
key: fs.readFileSync(process.env.wd + 'key.pem'),
|
||||||
|
cert: fs.readFileSync(process.env.wd + 'cert.pem'),
|
||||||
|
passprase: []
|
||||||
|
};
|
||||||
|
|
||||||
|
https.createServer(options,server).listen(process.env.nodeport, () => {
|
||||||
|
console.log('started on '+ process.env.nodeport)
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user