Skip to content

Commit

Permalink
Merge pull request #8 from HUITCLUB/signin
Browse files Browse the repository at this point in the history
Signin
  • Loading branch information
yoongun authored Jul 6, 2018
2 parents c7506c4 + eeeabfa commit 2f53d5e
Show file tree
Hide file tree
Showing 15 changed files with 606 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
server/node_modules/
server/credentials.js
29 changes: 18 additions & 11 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
'use strict'
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
const logger = require('morgan');
const sess = require('express-session')
// const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');

var index = require('./routes/index');
var portfolio = require('./routes/portfolio');
var blog = require('./routes/blog');
const index = require('./routes/index');
const portfolio = require('./routes/portfolio');
const blog = require('./routes/blog');
const auth = require('./routes/auth');

var app = express();
const app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
Expand All @@ -20,12 +22,17 @@ app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(sess({
resave : true,
saveUninitialized : false,
secret : process.env.SESSION_SECRET
}));
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', index);
app.use('/portfolio', portfolio);
app.use('/blog', blog);
app.use('/auth', auth);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
Expand Down
180 changes: 180 additions & 0 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "^4.16.3",
"express-session": "^1.15.6",
"jstransformer-markdown-it": "^2.1.0",
"katex": "^0.10.0-beta",
"markdown-it": "^8.4.1",
"markdown-it-texmath": "^0.4.7",
"mongodb": "^3.0.8",
"mongoose": "^5.2.1",
"morgan": "~1.9.0",
"passport": "^0.4.0",
"passport-github2": "^0.1.11",
"pug": "2.0.0-beta11",
"serve-favicon": "~2.4.5"
}
},
"devDependencies": {}
}
Loading

0 comments on commit 2f53d5e

Please sign in to comment.