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

feat(*): update several dependencies #53

Merged
merged 1 commit into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9,155 changes: 5,131 additions & 4,024 deletions package-lock.json

Large diffs are not rendered by default.

58 changes: 30 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
},
"jest": {
"globals": {
"__TS_CONFIG__": "tsconfig.json"
"ts-jest": {
"tsConfigFile": "tsconfig.json"
}
},
"moduleFileExtensions": [
"ts",
Expand All @@ -41,59 +43,59 @@
"testEnvironment": "node"
},
"dependencies": {
"async": "^2.1.2",
"async": "^2.5.0",
"bcrypt-nodejs": "^0.0.3",
"body-parser": "^1.15.2",
"compression": "^1.6.2",
"body-parser": "^1.18.2",
"compression": "^1.7.1",
"connect-mongo": "^1.3.2",
"dotenv": "^2.0.0",
"errorhandler": "^1.4.3",
"express": "^4.14.0",
"express-flash": "^0.0.2",
"express-session": "^1.14.2",
"express-validator": "^3.1.3",
"fbgraph": "^1.3.0",
"errorhandler": "^1.5.0",
"express": "^4.16.2",
"express-flash": "0.0.2",
"express-session": "^1.15.6",
"express-validator": "^4.2.1",
"fbgraph": "^1.4.1",
"lodash": "^4.17.4",
"lusca": "^1.4.1",
"mongoose": "^4.6.6",
"morgan": "^1.7.0",
"nodemailer": "^2.6.4",
"passport": "0.3.2",
"lusca": "^1.5.2",
"mongoose": "^4.12.4",
"morgan": "^1.9.0",
"nodemailer": "^2.7.2",
"passport": "^0.4.0",
"passport-facebook": "^2.1.1",
"passport-local": "^1.0.0",
"pug": "^2.0.0-beta6",
"request": "^2.78.0"
"pug": "^2.0.0-rc.4",
"request": "^2.83.0"
},
"devDependencies": {
"@types/async": "^2.0.40",
"@types/bcrypt-nodejs": "0.0.30",
"@types/body-parser": "^1.16.2",
"@types/compression": "0.0.33",
"@types/connect-mongo": "0.0.32",
"@types/connect-mongo": "0.0.34",
"@types/dotenv": "^2.0.20",
"@types/errorhandler": "0.0.30",
"@types/errorhandler": "0.0.32",
"@types/express": "^4.0.35",
"@types/express-session": "0.0.32",
"@types/jest": "^19.2.2",
"@types/jquery": "^2.0.41",
"@types/lodash": "^4.14.63",
"@types/mongodb": "^2.1.43",
"@types/express-session": "^1.15.5",
"@types/jest": "^21.1.5",
"@types/jquery": "^3.2.15",
"@types/lodash": "^4.14.80",
"@types/mongodb": "^2.2.15",
"@types/mongoose": "^4.7.9",
"@types/morgan": "^1.7.32",
"@types/node": "^7.0.12",
"@types/nodemailer": "^1.3.32",
"@types/passport": "^0.3.3",
"@types/passport-facebook": "^2.1.3",
"@types/request": "0.0.45",
"@types/request": "^2.0.7",
"@types/supertest": "^2.0.0",
"concurrently": "^3.4.0",
"jest": "^19.0.2",
"jest": "^21.2.1",
"node-sass": "^4.5.2",
"nodemon": "^1.11.0",
"shelljs": "^0.7.7",
"supertest": "^2.0.1",
"ts-jest": "^19.0.8",
"tslint": "^5.0.0",
"ts-jest": "^21.1.4",
"tslint": "^5.8.0",
"typescript": "^2.4.0"
}
}
17 changes: 9 additions & 8 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import * as express from "express";
import * as compression from "compression"; // compresses requests
import * as session from "express-session";
import * as expressValidator from "express-validator";
import * as bodyParser from "body-parser";
import * as logger from "morgan";
import * as errorHandler from "errorhandler";
Expand All @@ -14,7 +15,6 @@ import * as flash from "express-flash";
import * as path from "path";
import * as mongoose from "mongoose";
import * as passport from "passport";
import expressValidator = require("express-validator");


const MongoStore = mongo(session);
Expand Down Expand Up @@ -47,8 +47,9 @@ const app = express();
* Connect to MongoDB.
*/
// mongoose.Promise = global.Promise;
mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI);

mongoose.connect(process.env.MONGODB_URI || process.env.MONGOLAB_URI, {
useMongoClient: true
});
mongoose.connection.on("error", () => {
console.log("MongoDB connection error. Please make sure MongoDB is running.");
process.exit();
Expand Down Expand Up @@ -88,13 +89,13 @@ app.use((req, res, next) => {
app.use((req, res, next) => {
// After successful login, redirect back to the intended page
if (!req.user &&
req.path !== "/login" &&
req.path !== "/signup" &&
!req.path.match(/^\/auth/) &&
!req.path.match(/\./)) {
req.path !== "/login" &&
req.path !== "/signup" &&
!req.path.match(/^\/auth/) &&
!req.path.match(/\./)) {
req.session.returnTo = req.path;
} else if (req.user &&
req.path == "/account") {
req.path == "/account") {
req.session.returnTo = req.path;
}
next();
Expand Down
6 changes: 3 additions & 3 deletions test/api.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {} from 'jest';
import * as supertest from "supertest";

const request = supertest("http://localhost:8000");
import * as app from "../src/server";

describe("GET /api", () => {
const request = supertest(app);

it("should return 200 OK", () => {
request
.get("/api")
Expand Down
5 changes: 3 additions & 2 deletions test/app.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {} from 'jest';
import * as supertest from "supertest";
const request = supertest("http://localhost:8000");
import * as app from "../src/server";

describe("GET /random-url", () => {
const request = supertest(app);

it("should return 404", (done) => {
request.get("/reset")
.expect(404, done);
Expand Down
5 changes: 3 additions & 2 deletions test/contact.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {} from 'jest';
import * as supertest from "supertest";
const request = supertest("http://localhost:8000");
import * as app from "../src/server";

describe("GET /contact", () => {
const request = supertest(app);

it("should return 200 OK", (done) => {
request.get("/contact")
.expect(200, done);
Expand Down
5 changes: 3 additions & 2 deletions test/home.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {} from 'jest';
import * as supertest from "supertest";
const request = supertest("http://localhost:8000");
import * as app from "../src/server";

describe("GET /", () => {
const request = supertest(app);

it("should return 200 OK", (done) => {
request.get("/")
.expect(200, done);
Expand Down
5 changes: 3 additions & 2 deletions test/user.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {} from 'jest';
import * as supertest from "supertest";
const request = supertest("http://localhost:8000");
import * as app from "../src/server";

const request = supertest(app);

describe("GET /login", () => {
it("should return 200 OK", (done) => {
Expand Down