1
0
mirror of https://github.com/microsoft/TypeScript-Node-Starter.git synced 2025-11-09 00:37:27 +00:00

feat(*): update several dependencies

This commit is contained in:
Alan Agius
2017-10-29 14:01:58 +01:00
parent e248ffdc4d
commit feac6cccf7
8 changed files with 4583 additions and 3469 deletions

7951
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -26,7 +26,9 @@
},
"jest": {
"globals": {
"__TS_CONFIG__": "tsconfig.json"
"ts-jest": {
"tsConfigFile": "tsconfig.json"
}
},
"moduleFileExtensions": [
"ts",
@@ -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"
}
}

View File

@@ -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";
@@ -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);
@@ -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();
@@ -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();

View File

@@ -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")

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) => {