-
Notifications
You must be signed in to change notification settings - Fork 0
Test gh app #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
charlieblevins
wants to merge
5
commits into
master
Choose a base branch
from
testGHApp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Test gh app #4
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
46084c2
this message does not begin with M
charlieblevins fbda039
M this message does begin with M
charlieblevins 8c62355
Merge branch 'testGHApp' of github.com:charlieblevins/dukweb into tes…
charlieblevins bca2a58
testing codefactor
charlieblevins fea3c68
testing codefactor
charlieblevins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # dukweb | ||
| o# dukweb | ||
| Api Companion to Duk iOS App | ||
| Edit 2 | ||
| Edit 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,116 +1,116 @@ | ||||||
| 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'); | ||||||
|
|
||||||
| // Set project root | ||||||
| global.appRoot = path.resolve(__dirname); | ||||||
|
|
||||||
| var app = express(); | ||||||
|
|
||||||
| // Configure locals | ||||||
| app.locals.moment = require('moment'); | ||||||
|
|
||||||
| // Db configuration | ||||||
| var dbConfig = require('./db.js'); | ||||||
| var mongoose = require('mongoose'); | ||||||
|
|
||||||
| // Fix for promise depracation warning | ||||||
| mongoose.Promise = global.Promise; | ||||||
|
|
||||||
| mongoose.connect(dbConfig.getURL()); | ||||||
| var db = mongoose.connection; | ||||||
|
|
||||||
| db.on('error', console.error.bind(console, 'connection error:')); | ||||||
|
|
||||||
| db.once('open', function () { | ||||||
| console.log('connected to database'); | ||||||
| }); | ||||||
|
|
||||||
| // view engine setup | ||||||
| app.set('views', path.join(__dirname, 'views')); | ||||||
| app.set('view engine', 'jade'); | ||||||
|
|
||||||
| // uncomment after placing your favicon in /public | ||||||
| //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); | ||||||
| app.use(logger('dev')); | ||||||
| app.use(bodyParser.json()); | ||||||
| app.use(bodyParser.urlencoded({ extended: true })); | ||||||
| app.use(cookieParser()); | ||||||
|
|
||||||
| // Static files | ||||||
| app.use(express.static(path.join(__dirname, 'public'))); | ||||||
|
|
||||||
| // Configure passport and session | ||||||
| var passport = require('passport'); | ||||||
| var session = require('express-session'); | ||||||
| app.use(session({ | ||||||
| secret: 'bob the basset', | ||||||
| resave: false, | ||||||
| saveUninitialized: false | ||||||
| })); | ||||||
| app.use(passport.initialize()); | ||||||
| app.use(passport.session()); | ||||||
|
|
||||||
| var flash = require('connect-flash'); | ||||||
| app.use(flash()); | ||||||
|
|
||||||
| // Initialize Passport | ||||||
| var initPassport = require('./passport/init'); | ||||||
| initPassport(passport); | ||||||
|
|
||||||
| // Allow index router to handle all incoming requests | ||||||
| var routes = require('./routes/index')(passport); | ||||||
| app.use('/', routes); | ||||||
|
|
||||||
| // catch 404 and forward to error handler | ||||||
| app.use(function(req, res, next) { | ||||||
| console.log(404); | ||||||
| res.status(404); | ||||||
|
|
||||||
| // respond with html page | ||||||
| if (req.accepts('html')) { | ||||||
| res.render('error', { url: req.url }); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // respond with json | ||||||
| if (req.accepts('json')) { | ||||||
| res.send({ error: 'This resource does not exist.' }); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // default to plain-text. send() | ||||||
| res.type('txt').send('This resource does not exist.'); | ||||||
| }); | ||||||
|
|
||||||
| // error handlers | ||||||
|
|
||||||
| // development error handler | ||||||
| // will print stacktrace | ||||||
| if (app.get('env') === 'development') { | ||||||
| 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'); | ||||||
|
|
||||||
| // Set project root | ||||||
| global.appRoot = path.resolve(__dirname); | ||||||
|
|
||||||
| var app = express(); | ||||||
|
|
||||||
| // Configure locals | ||||||
| app.locals.moment = require('moment'); | ||||||
|
|
||||||
| // Db configuration | ||||||
| var dbConfig = require('./db.js'); | ||||||
| var mongoose = require('mongoose'); | ||||||
|
|
||||||
| // Fix for promise depracation warning | ||||||
| mongoose.Promise = global.Promise; | ||||||
|
|
||||||
| mongoose.connect(dbConfig.getURL()); | ||||||
| var db = mongoose.connection; | ||||||
|
|
||||||
| db.on('error', console.error.bind(console, 'connection error:')); | ||||||
|
|
||||||
| db.once('open', function () { | ||||||
| console.log('connected to database'); | ||||||
| }); | ||||||
|
|
||||||
| // view engine setup | ||||||
| app.set('views', path.join(__dirname, 'views')); | ||||||
| app.set('view engine', 'jade'); | ||||||
|
|
||||||
| // uncomment after placing your favicon in /public | ||||||
| //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); | ||||||
| app.use(logger('dev')); | ||||||
| app.use(bodyParser.json()); | ||||||
| app.use(bodyParser.urlencoded({ extended: true })); | ||||||
| app.use(cookieParser()); | ||||||
|
|
||||||
| // Static files | ||||||
| app.use(express.static(path.join(__dirname, 'public'))); | ||||||
|
|
||||||
| // Configure passport and session | ||||||
| var passport = require('passport'); | ||||||
| var session = require('express-session'); | ||||||
| app.use(session({ | ||||||
| secret: 'bob the basset', | ||||||
| resave: false, | ||||||
| saveUninitialized: false | ||||||
| })); | ||||||
| app.use(passport.initialize()); | ||||||
| app.use(passport.session()); | ||||||
|
|
||||||
| var flash = require('connect-flash'); | ||||||
| app.use(flash()); | ||||||
|
|
||||||
| // Initialize Passport | ||||||
| var initPassport = require('./passport/init'); | ||||||
| initPassport(passport); | ||||||
|
|
||||||
| // Allow index router to handle all incoming requests | ||||||
| var routes = require('./routes/index')(passport); | ||||||
| app.use('/', routes); | ||||||
|
|
||||||
| // catch 404 and forward to error handler | ||||||
| app.use(function(req, res, next) { | ||||||
| console.log(404); | ||||||
| res.status(404); | ||||||
|
|
||||||
| // respond with html page | ||||||
| if (req.accepts('html')) { | ||||||
| res.render('error', { url: req.url }); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // respond with json | ||||||
| if (req.accepts('json')) { | ||||||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Strings must use doublequote.
Suggested change
|
||||||
| res.send({ error: 'This resource does not exist.' }); | ||||||
| return; | ||||||
| } | ||||||
|
|
||||||
| // default to plain-text. send() | ||||||
| res.type('txt').send('This resource does not exist.'); | ||||||
| }); | ||||||
|
|
||||||
| // error handlers | ||||||
|
|
||||||
| // development error handler | ||||||
| // will print stacktrace | ||||||
| if (app.get('env') === 'development') { | ||||||
| app.use(function(err, req, res, next) { | ||||||
| console.log('500 error: ', err); | ||||||
| res.status(err.status || 500); | ||||||
| res.render('error', { | ||||||
| message: err.message, | ||||||
| error: err | ||||||
| }); | ||||||
| }); | ||||||
| } | ||||||
|
|
||||||
| // production error handler | ||||||
| // no stacktraces leaked to user | ||||||
| app.use(function(err, req, res, next) { | ||||||
| console.log('500 error: ', err); | ||||||
| res.status(err.status || 500); | ||||||
| res.render('error', { | ||||||
| message: err.message, | ||||||
| error: err | ||||||
| error: {} | ||||||
| }); | ||||||
| }); | ||||||
| } | ||||||
|
|
||||||
| // production error handler | ||||||
| // no stacktraces leaked to user | ||||||
| app.use(function(err, req, res, next) { | ||||||
| console.log('500 error: ', err); | ||||||
| res.status(err.status || 500); | ||||||
| res.render('error', { | ||||||
| message: err.message, | ||||||
| error: {} | ||||||
| }); | ||||||
| }); | ||||||
|
|
||||||
|
|
||||||
| module.exports = app; | ||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Strings must use doublequote.