Initial commit

This commit is contained in:
Dessa Simpson 2020-06-24 21:34:53 +00:00
commit ce518aeeb5
16 changed files with 1755 additions and 0 deletions

13
src/app.ts Normal file
View file

@ -0,0 +1,13 @@
import * as config from "./config";
import express from "express";
import db from "./db";
const app = express();
app.use(express.static('public'));
app.use(express.json());
app.get("/test", (request, response) => response.send("Test"))
const server = app.listen(config.port, () => {
console.log(`Listening on port ${config.port}`);
});

6
src/config.ts Normal file
View file

@ -0,0 +1,6 @@
if (!process.env.PORT) {
console.log("Missing environment variable PORT");
process.exit(1);
}
export const port: number = parseInt(process.env.PORT as string, 10);

5
src/db.ts Normal file
View file

@ -0,0 +1,5 @@
const { Pool } = require('pg');
const db = new Pool();
export = db;