Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 4d90599

Browse files
author
Bowden Kelly
authored
Merge pull request #92 from Microsoft/addAzure
Add Azure publish support
2 parents fc4c2b2 + 56993dd commit 4d90599

File tree

11 files changed

+290
-59
lines changed

11 files changed

+290
-59
lines changed

.env.example

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
MONGODB_URI=mongodb://localhost:27017
2-
MONGOLAB_URI=mongodb://localhost:27017
31

2+
# Note we depend on NODE_ENV being set to dictate which of the env variables below get loaded at runtime.
3+
# See README for more details.
4+
5+
# Get this from https://mlab.com/home after you've logged in and created a database
6+
MONGODB_URI=mongodb://<mlab_user>:<mlab_password>@<mlab_connection_url>
7+
8+
# This is standard running mongodb locally
9+
MONGODB_URI_LOCAL=mongodb://localhost:27017
10+
11+
# Put lots of randomness in these
412
SESSION_SECRET=ashdfjhasdlkjfhalksdjhflak
513

14+
# Facebook keys - register your app and get yours here: https://developers.facebook.com/
615
FACEBOOK_ID=754220301289665
716
FACEBOOK_SECRET=41860e58c256a3d7ad8267d3c1939a4a

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ logs
1313
results
1414
tmp
1515

16-
#Build
16+
# Build
1717
public/css/main.css
1818

19+
# Coverage reports
20+
coverage
21+
1922
# API keys and secrets
2023
.env
2124

.vscode/settings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
"search.exclude": {
44
"**/node_modules": true,
55
"**/bower_components": true,
6-
"**/dist": true
6+
"**/dist": true,
7+
"**/coverge": true
78
},
89
"typescript.referencesCodeLens.enabled": true,
910
"tslint.ignoreDefinitionFiles": false,
1011
"tslint.autoFixOnSave": true,
1112
"tslint.exclude": "**/node_modules/**/*",
1213
"cSpell.words": [
13-
"definitelytyped"
14+
"csrf",
15+
"definitelytyped",
16+
"promisified"
1417
]
1518
}

README.md

Lines changed: 139 additions & 27 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 78 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@
4242
"lodash": "^4.17.4",
4343
"lusca": "^1.5.2",
4444
"mongoose": "^4.13.11",
45-
"morgan": "^1.9.0",
4645
"nodemailer": "^4.4.1",
4746
"passport": "^0.4.0",
4847
"passport-facebook": "^2.1.1",
4948
"passport-local": "^1.0.0",
5049
"pug": "^2.0.0-rc.4",
51-
"request": "^2.83.0"
50+
"request": "^2.83.0",
51+
"request-promise": "^4.2.2",
52+
"winston": "^2.4.0"
5253
},
5354
"devDependencies": {
5455
"@types/async": "^2.0.45",
@@ -76,6 +77,7 @@
7677
"@types/request": "^2.47.0",
7778
"@types/shelljs": "^0.7.8",
7879
"@types/supertest": "^2.0.4",
80+
"@types/winston": "^2.3.7",
7981
"chai": "^4.1.2",
8082
"concurrently": "^3.5.1",
8183
"jest": "^22.0.4",

src/app.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import express from "express";
22
import compression from "compression"; // compresses requests
33
import session from "express-session";
44
import bodyParser from "body-parser";
5-
import logger from "morgan";
5+
import logger from "./util/logger";
66
import lusca from "lusca";
77
import dotenv from "dotenv";
88
import mongo from "connect-mongo";
@@ -12,6 +12,7 @@ import mongoose from "mongoose";
1212
import passport from "passport";
1313
import expressValidator from "express-validator";
1414
import bluebird from "bluebird";
15+
import { MONGODB_URI, SESSION_SECRET } from "./util/secrets";
1516

1617
const MongoStore = mongo(session);
1718

@@ -32,7 +33,7 @@ import * as passportConfig from "./config/passport";
3233
const app = express();
3334

3435
// Connect to MongoDB
35-
const mongoUrl = process.env.MONGOLAB_URI;
36+
const mongoUrl = MONGODB_URI;
3637
(<any>mongoose).Promise = bluebird;
3738
mongoose.connect(mongoUrl, {useMongoClient: true}).then(
3839
() => { /** ready to use. The `mongoose.connect()` promise resolves to undefined. */ },
@@ -46,14 +47,13 @@ app.set("port", process.env.PORT || 3000);
4647
app.set("views", path.join(__dirname, "../views"));
4748
app.set("view engine", "pug");
4849
app.use(compression());
49-
app.use(logger("dev"));
5050
app.use(bodyParser.json());
5151
app.use(bodyParser.urlencoded({ extended: true }));
5252
app.use(expressValidator());
5353
app.use(session({
5454
resave: true,
5555
saveUninitialized: true,
56-
secret: process.env.SESSION_SECRET,
56+
secret: SESSION_SECRET,
5757
store: new MongoStore({
5858
url: mongoUrl,
5959
autoReconnect: true

0 commit comments

Comments
 (0)