Skip to content

Commit

Permalink
Merge branch 'hotfix/deployment'
Browse files Browse the repository at this point in the history
  • Loading branch information
petschekr committed Jan 19, 2017
2 parents 8ba17b1 + d06d19f commit 250e22d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions server/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from "fs";
import * as path from "path";
import * as url from "url";
import * as os from "os";
import * as crypto from "crypto";
import * as http from "http";
Expand Down Expand Up @@ -37,12 +38,12 @@ import * as WebSocket from "ws";
import * as cheerio from "cheerio";

const PORT = parseInt(process.env.PORT) || 3000;
const MONGO_URL = process.env.MONGO_URL || 'mongodb://localhost/';
const UNIQUE_APP_ID = process.env.UNIQUE_APP_ID || 'ultimate-checkin';
const MONGO_URL = process.env.MONGO_URL || "mongodb://localhost/";
const UNIQUE_APP_ID = process.env.UNIQUE_APP_ID || "ultimate-checkin";
const STATIC_ROOT = "../client";

const VERSION_NUMBER = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8")).version;
const VERSION_HASH = require("child_process").execSync("git rev-parse --short HEAD").toString().trim();
const VERSION_HASH = process.env.VERSION_HASH || require("git-rev-sync").short();

let app = express();
app.use(compression());
Expand All @@ -55,7 +56,7 @@ let cookieParserInstance = cookieParser(undefined, {
app.use(cookieParserInstance);

(<any>mongoose).Promise = global.Promise;
mongoose.connect(`${MONGO_URL}/${UNIQUE_APP_ID}`);
mongoose.connect(url.resolve(MONGO_URL, UNIQUE_APP_ID));

interface IUser {
username: string;
Expand Down
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "check-in",
"version": "1.0.0",
"version": "1.0.1",
"description": "Check in for HackGT events",
"main": "app.js",
"scripts": {
Expand All @@ -15,6 +15,7 @@
"cookie-parser": "^1.4.3",
"csv-parse": "^1.1.9",
"express": "^4.14.0",
"git-rev-sync": "^1.8.0",
"material-components-web": "^0.2.0",
"mongoose": "^4.7.6",
"multer": "^1.2.1",
Expand Down

0 comments on commit 250e22d

Please sign in to comment.