From f0b1daa0023f661b0d3f82aec952c90526abab8e Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 15 Aug 2019 17:00:11 +0000 Subject: [PATCH] initial blank express server for tps project --- package.json | 22 ++++++++++++++++++++++ server.js | 23 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 package.json create mode 100644 server.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..271b041 --- /dev/null +++ b/package.json @@ -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" + } +} diff --git a/server.js b/server.js new file mode 100644 index 0000000..943f677 --- /dev/null +++ b/server.js @@ -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) +}); \ No newline at end of file