-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from RUGSoftEng/release
Release
- Loading branch information
Showing
44 changed files
with
4,102 additions
and
940 deletions.
There are no files selected for viewing
This file contains 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,2 +1,3 @@ | ||
node_modules/ | ||
.DS_Store | ||
npm-debug.log |
This file contains 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 |
---|---|---|
|
@@ -4,6 +4,31 @@ Running project: [VIEW](https://medid.herokuapp.com/) | |
|
||
Client-side documentation: [VIEW](https://htmlpreview.github.io/?https://raw.githubusercontent.com/RUGSoftEng/2017-Medical-ID/develop/doc/index.html) | ||
|
||
**Install and run instructions:** | ||
Ensure you have Python2.7 and NodeJS installed on your machine. | ||
|
||
In forgot.js, there are two sections as such: | ||
|
||
'''sh | ||
auth: { | ||
user: '[email protected]', | ||
pass: 'enterpasswordhere' | ||
} | ||
''' | ||
|
||
Here, you should enter the username and password of the account you would like to send the password reset emails. | ||
|
||
Once the above has been done, run the following commands from the terminal: | ||
|
||
```sh | ||
$ npm install | ||
``` | ||
|
||
```sh | ||
$ npm start | ||
``` | ||
|
||
|
||
### cmd Reminders ### | ||
|
||
**Obtaining files:** | ||
|
@@ -27,12 +52,3 @@ git push --follow-tags | |
**Delete tag:** | ||
git tag -d tagName | ||
git push --delete origin tagName | ||
|
||
**Install and run instructions:** | ||
```sh | ||
$ npm install | ||
``` | ||
|
||
```sh | ||
$ npm start | ||
``` |
This file contains 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 |
---|---|---|
|
@@ -10,9 +10,14 @@ var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; | ||
var mongo = require('mongodb'); | ||
var mongoose = require('mongoose'); | ||
var serverSettings = require('./serverSettings.js'); | ||
var forceHttps = require('express-force-https'); | ||
|
||
mongoose.connect('mongodb://root:[email protected]:27017,med-shard-00-01-mgwxu.mongodb.net:27017,med-shard-00-02-mgwxu.mongodb.net:27017/loginapp?ssl=true&replicaSet=med-shard-0&authSource=admin'); | ||
mongoose.connect(serverSettings.parameters.db || 'mongodb://root:[email protected]:27017,med-shard-00-01-mgwxu.mongodb.net:27017,med-shard-00-02-mgwxu.mongodb.net:27017/loginapp?ssl=true&replicaSet=med-shard-0&authSource=admin'); | ||
if (serverSettings.parameters.db) { | ||
console.log("Connected to custom database '" + serverSettings.parameters.db + "'."); | ||
} | ||
|
||
//mongoose.connect('mongodb://localhost/loginapp'); | ||
var db = mongoose.connection; | ||
|
||
|
@@ -47,8 +52,12 @@ app.use(session({ | |
resave: true | ||
})); | ||
|
||
// Force HTTPS when not running on localhost | ||
app.use(forceHttps); | ||
// Force HTTPS when not connecting to localhost | ||
if (!serverSettings.parameters.http) { | ||
app.use(forceHttps); | ||
} else { | ||
console.log("Warning: running in (unsecure) HTTP mode."); | ||
} | ||
|
||
// Passport init | ||
app.use(passport.initialize()); | ||
|
@@ -98,5 +107,5 @@ app.use('/forgot', forgot); | |
app.set('port', (process.env.PORT || 3000)); | ||
|
||
app.listen(app.get('port'), function(){ | ||
console.log('Server started on port '+app.get('port')); | ||
console.log("Server started on port " + app.get('port') + "."); | ||
}); |
This file contains 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
Oops, something went wrong.