Error: 500 - Oh Noes!
++
{{ error }}+
diff --git a/.app.js.~undo-tree~ b/.app.js.~undo-tree~ new file mode 100644 index 0000000..c36a2f7 --- /dev/null +++ b/.app.js.~undo-tree~ @@ -0,0 +1,37 @@ +"76b3ec33e748f46bf56db15f03b3442ab860073c" +[cl-struct-undo-tree [nil ([nil ([nil ([nil (#1=[nil nil ((3119 . 3120) (t 23090 44111 41748 945000)) nil (23090 44322 492315 176000) 0 nil]) ((4267 . 4323) (" res.status(500).render('errors/500', { error: err }); +" . 4267) (undo-tree-id0 . -56) (3806 . 3887) ("process.env.NODE_ENV === 'production' ? (args = [port]) : (args = [port, host]); +" . 3806) (undo-tree-id1 . -81) (3769 . 3795) ("const host = 'localhost'; +" . 3769) (undo-tree-id2 . -26) (3536 . 3612) (#("app.engine('handlebars', hbs.engine); +app.set('view engine', 'handlebars'); +" 0 10 (fontified t) 10 11 (fontified t face (rainbow-delimiters-depth-1-face)) 11 23 (fontified t face font-lock-string-face) 23 35 (fontified t) 35 36 (fontified t face (rainbow-delimiters-depth-1-face)) 36 45 (fontified t) 45 46 (fontified t face (rainbow-delimiters-depth-1-face)) 46 59 (fontified t face font-lock-string-face) 59 61 (fontified t) 61 73 (fontified t face font-lock-string-face) 73 74 (fontified t face (rainbow-delimiters-depth-1-face)) 74 76 (fontified t)) . 3536) (undo-tree-id3 . -76) (3475 . 3531) (#(" partialsDir: 'views/', + defaultLayout: 'application' +" 0 15 (fontified t) 15 23 (fontified t face font-lock-string-face) 23 42 (fontified t) 42 55 (fontified t face font-lock-string-face) 55 56 (fontified t)) . 3475) (undo-tree-id4 . -25) (undo-tree-id5 . -25) (undo-tree-id6 . -56) (undo-tree-id7 . -56) (undo-tree-id8 . -56) (3320 . 3415) (#("const expressHandlebars = require('express-handlebars'); +const helpers = require('./helpers'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 23 (fontified t face font-lock-variable-name-face) 23 33 (fontified t) 33 34 (fontified t face (rainbow-delimiters-depth-1-face)) 34 54 (fontified t face font-lock-string-face) 54 55 (fontified t face (rainbow-delimiters-depth-1-face)) 55 57 (fontified t) 57 62 (fontified t face font-lock-keyword-face) 62 63 (fontified t) 63 70 (fontified t face font-lock-variable-name-face) 70 80 (fontified t) 80 81 (fontified t face (rainbow-delimiters-depth-1-face)) 81 92 (fontified t face font-lock-string-face) 92 93 (fontified t face (rainbow-delimiters-depth-1-face)) 93 95 (fontified t)) . 3320) (undo-tree-id9 . -57) (undo-tree-id10 . -57) (undo-tree-id11 . -95) (undo-tree-id12 . -95) (undo-tree-id13 . -95) (3009 . 3212) (#("const home = require('./routers/home'); +const ponzvert = require('./routers/ponzvert'); +const shop = require('/routers/shop'); +app.use('/', home); +app.use('/ponzvert', ponzvert); +app.use('/shop', shop); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 10 (fontified t face font-lock-variable-name-face) 10 20 (fontified t) 20 21 (fontified t face (rainbow-delimiters-depth-1-face)) 21 37 (fontified t face font-lock-string-face) 37 38 (fontified t face (rainbow-delimiters-depth-1-face)) 38 40 (fontified t) 40 45 (fontified t face font-lock-keyword-face) 45 46 (fontified t) 46 54 (fontified t face font-lock-variable-name-face) 54 60 (fontified t) 60 64 (fontified t) 64 65 (fontified t face (rainbow-delimiters-depth-1-face)) 65 85 (fontified t face font-lock-string-face) 85 86 (fontified t face (rainbow-delimiters-depth-1-face)) 86 87 (fontified t) 87 88 (fontified t) 88 93 (fontified t face font-lock-keyword-face) 93 94 (fontified t) 94 98 (fontified t face font-lock-variable-name-face) 98 108 (fontified t) 108 109 (fontified t face (rainbow-delimiters-depth-1-face)) 109 123 (fontified t face font-lock-string-face) 123 124 (fontified t face font-lock-string-face) 124 125 (fontified t face (rainbow-delimiters-depth-1-face)) 125 126 (fontified t) 126 127 (fontified t) 127 134 (fontified t) 134 135 (fontified t face (rainbow-delimiters-depth-1-face)) 135 138 (fontified t face font-lock-string-face) 138 144 (fontified t) 144 145 (fontified t face (rainbow-delimiters-depth-1-face)) 145 147 (fontified t) 147 154 (fontified t) 154 155 (fontified t face (rainbow-delimiters-depth-1-face)) 155 166 (fontified t face font-lock-string-face) 166 176 (fontified t) 176 177 (fontified t face (rainbow-delimiters-depth-1-face)) 177 178 (fontified t) 178 179 (fontified t) 179 186 (fontified t) 186 187 (fontified t face (rainbow-delimiters-depth-1-face)) 187 194 (fontified t face font-lock-string-face) 194 200 (fontified t) 200 201 (fontified t face (rainbow-delimiters-depth-1-face)) 201 202 (fontified t) 202 203 (fontified t)) . 3009) (undo-tree-id14 . -203) (undo-tree-id15 . -203) (undo-tree-id16 . -179) (undo-tree-id17 . -179) (undo-tree-id18 . -147) (undo-tree-id19 . -147) (undo-tree-id20 . -127) (undo-tree-id21 . -127) (undo-tree-id22 . -88) (undo-tree-id23 . -88) (undo-tree-id24 . -40) (undo-tree-id25 . -40) (undo-tree-id26 . 77) (undo-tree-id27 . 78) (undo-tree-id28 . 78) (undo-tree-id29 . -125) (undo-tree-id30 . -125) (undo-tree-id31 . -125) (undo-tree-id32 . -203) (2679 . 2755) (#(" return done(null, false, { message: 'Invalid username/password' }); +" 0 8 (fontified t) 8 14 (fontified t face font-lock-keyword-face) 14 19 (fontified t) 19 20 (fontified t face (rainbow-delimiters-depth-7-face)) 20 24 (fontified t face font-lock-constant-face) 24 26 (fontified t) 26 31 (fontified t face font-lock-constant-face) 31 33 (fontified t) 33 34 (fontified t face (rainbow-delimiters-depth-8-face)) 34 44 (fontified t) 44 71 (fontified t face font-lock-string-face) 71 72 (fontified t) 72 73 (fontified t face (rainbow-delimiters-depth-8-face)) 73 74 (fontified t face (rainbow-delimiters-depth-7-face)) 74 76 (fontified t)) . 2679) (undo-tree-id33 . -76) (2381 . 2439) (#("const LocalStrategy = require('passport-local').Strategy; +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 19 (fontified t face font-lock-variable-name-face) 19 29 (fontified t) 29 30 (fontified t face (rainbow-delimiters-depth-1-face)) 30 46 (fontified t face font-lock-string-face) 46 47 (fontified t face (rainbow-delimiters-depth-1-face)) 47 58 (fontified t)) . 2381) (undo-tree-id34 . -58) (undo-tree-id35 . -58) (undo-tree-id36 . -58) (2252 . 2375) (#("const User = require('./models/User'); +const mongoose = require('mongoose'); +mongoose.connect('mongodb://localhost/test'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 10 (fontified t face font-lock-variable-name-face) 10 20 (fontified t) 20 21 (fontified t face (rainbow-delimiters-depth-1-face)) 21 36 (fontified t face font-lock-string-face) 36 37 (fontified t face (rainbow-delimiters-depth-1-face)) 37 39 (fontified t) 39 44 (fontified t face font-lock-keyword-face) 44 45 (fontified t) 45 53 (fontified t face font-lock-variable-name-face) 53 63 (fontified t) 63 64 (fontified t face (rainbow-delimiters-depth-1-face)) 64 74 (fontified t face font-lock-string-face) 74 75 (fontified t face (rainbow-delimiters-depth-1-face)) 75 93 (fontified t) 93 94 (fontified t face (rainbow-delimiters-depth-1-face)) 94 120 (fontified t face font-lock-string-face) 120 121 (fontified t face (rainbow-delimiters-depth-1-face)) 121 123 (fontified t)) . 2252) (undo-tree-id37 . -123) (undo-tree-id38 . -123) (undo-tree-id39 . -123) (2152 . 2190) (#("const passport = require('passport'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 14 (fontified t face font-lock-variable-name-face) 14 24 (fontified t) 24 25 (fontified t face (rainbow-delimiters-depth-1-face)) 25 35 (fontified t face font-lock-string-face) 35 36 (fontified t face (rainbow-delimiters-depth-1-face)) 36 38 (fontified t)) . 2152) (undo-tree-id40 . -38) (1892 . 1983) (#("const morgan = require('morgan'); +const morganToolkit = require('morgan-toolkit')(morgan); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 12 (fontified t face font-lock-variable-name-face) 12 22 (fontified t) 22 23 (fontified t face (rainbow-delimiters-depth-1-face)) 23 31 (fontified t face font-lock-string-face) 31 32 (fontified t face (rainbow-delimiters-depth-1-face)) 32 34 (fontified t) 34 39 (fontified t face font-lock-keyword-face) 39 40 (fontified t) 40 53 (fontified t face font-lock-variable-name-face) 53 63 (fontified t) 63 64 (fontified t face (rainbow-delimiters-depth-1-face)) 64 80 (fontified t face font-lock-string-face) 80 81 (fontified t face (rainbow-delimiters-depth-1-face)) 81 82 (fontified t face (rainbow-delimiters-depth-1-face)) 82 88 (fontified t) 88 89 (fontified t face (rainbow-delimiters-depth-1-face)) 89 91 (fontified t)) . 1892) (undo-tree-id41 . -91) (undo-tree-id42 . -91) (undo-tree-id43 . -91) (1577 . 1631) (#(" req.session.backUrl = req.header('Referer') || '/'; +" 0 34 (fontified t) 34 35 (fontified t face (rainbow-delimiters-depth-3-face)) 35 44 (fontified t face font-lock-string-face) 44 45 (fontified t face (rainbow-delimiters-depth-3-face)) 45 49 (fontified t) 49 52 (fontified t face font-lock-string-face) 52 54 (fontified t)) . 1577) (undo-tree-id44 . -54) (1196 . 1323) (#("const methodOverride = require('method-override'); +const getPostSupport = require('express-method-override-get-post-support'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 20 (fontified t face font-lock-variable-name-face) 20 30 (fontified t) 30 31 (fontified t face (rainbow-delimiters-depth-1-face)) 31 48 (fontified t face font-lock-string-face) 48 49 (fontified t face (rainbow-delimiters-depth-1-face)) 49 51 (fontified t) 51 56 (fontified t face font-lock-keyword-face) 56 57 (fontified t) 57 71 (fontified t face font-lock-variable-name-face) 71 81 (fontified t) 81 82 (fontified t face (rainbow-delimiters-depth-1-face)) 82 124 (fontified t face font-lock-string-face) 124 125 (fontified t face (rainbow-delimiters-depth-1-face)) 125 127 (fontified t)) . 1196) (undo-tree-id45 . -127) (undo-tree-id46 . -127) (undo-tree-id47 . -127) (1021 . 1070) (#("const flash = require('express-flash-messages'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 11 (fontified t face font-lock-variable-name-face) 11 21 (fontified t) 21 22 (fontified t face (rainbow-delimiters-depth-1-face)) 22 46 (fontified t face font-lock-string-face) 46 47 (fontified t face (rainbow-delimiters-depth-1-face)) 47 49 (fontified t)) . 1021) (undo-tree-id48 . -49) (753 . 825) (#(" name: 'session', + keys: [process.env.SESSION_SECRET || 'secret'] +" 0 10 (fontified t) 10 19 (fontified t face font-lock-string-face) 19 31 (fontified t) 31 32 (fontified t face (rainbow-delimiters-depth-4-face)) 32 62 (fontified t) 62 70 (fontified t face font-lock-string-face) 70 71 (fontified t face (rainbow-delimiters-depth-4-face)) 71 72 (fontified t)) . 753) (undo-tree-id49 . -72) (676 . 725) (#("const cookieSession = require('cookie-session'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 19 (fontified t face font-lock-variable-name-face) 19 29 (fontified t) 29 30 (fontified t face (rainbow-delimiters-depth-1-face)) 30 46 (fontified t face font-lock-string-face) 46 47 (fontified t face (rainbow-delimiters-depth-1-face)) 47 49 (fontified t)) . 676) (undo-tree-id50 . -49) (undo-tree-id51 . -49) (undo-tree-id52 . -49) (472 . 515) (#("const bodyParser = require('body-parser'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 16 (fontified t face font-lock-variable-name-face) 16 26 (fontified t) 26 27 (fontified t face (rainbow-delimiters-depth-1-face)) 27 29 (fontified t face font-lock-string-face) 29 40 (fontified t face font-lock-string-face) 40 41 (fontified t face (rainbow-delimiters-depth-1-face)) 41 43 (fontified t)) . 472) (undo-tree-id53 . -43) (291 . 366) (#("if (process.env.NODE_ENV !== 'production') { + require('dotenv').config(); +" 0 2 (fontified t face font-lock-keyword-face) 2 3 (fontified t) 3 4 (fontified t face (rainbow-delimiters-depth-1-face)) 4 29 (fontified t) 29 41 (fontified t face font-lock-string-face) 41 42 (fontified t face (rainbow-delimiters-depth-1-face)) 42 43 (fontified t) 43 44 (fontified t face (rainbow-delimiters-depth-1-face)) 44 54 (fontified t) 54 55 (fontified t face (rainbow-delimiters-depth-2-face)) 55 63 (fontified t face font-lock-string-face) 63 64 (fontified t face (rainbow-delimiters-depth-2-face)) 64 71 (fontified t) 71 72 (fontified t face (rainbow-delimiters-depth-2-face)) 72 73 (fontified t face (rainbow-delimiters-depth-2-face)) 73 75 (fontified t)) . 291) (undo-tree-id54 . -75) (166 . 195) (#("app.locals.appName = 'Ponz'; +" 0 21 (fontified t) 21 27 (fontified t face font-lock-string-face) 27 29 (fontified t)) . 166) (undo-tree-id55 . -29) (undo-tree-id56 . -29) (1 . 37) (#("const express = require('express'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 13 (fontified t face font-lock-variable-name-face) 13 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-1-face)) 24 33 (fontified t face font-lock-string-face) 33 34 (fontified t face (rainbow-delimiters-depth-1-face)) 34 36 (fontified t)) . 1) (undo-tree-id57 . -36)) nil (23090 44111 3437 582000) 0 nil]) ((3134 . 3135) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . 3134) (3133 . 3134) (#(" " 0 1 (fontified nil)) . -3133) (3133 . 3134) (#(")" 0 1 (fontified nil face font-lock-string-face)) . -3133) (3133 . 3134) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 3133) (3132 . 3133) (#(" " 0 1 (fontified nil)) . -3132) (3132 . 3133) (#("'" 0 1 (fontified nil face font-lock-string-face)) . -3132) (3129 . 3133) (3120 . 3129) (#("s" 0 1 (fontified t face font-lock-string-face)) . -3120) (undo-tree-id58 . -1) (#("h" 0 1 (fontified t face font-lock-string-face)) . -3121) (undo-tree-id59 . -1) 3122 (3119 . 3122) (3118 . 3120) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . -3118) (3118 . 3119) (3117 . 3119) (#("(" 0 1 (fontified nil)) . -3117) (3097 . 3118) (3096 . 3097) 3071) nil (23090 44111 3451 790000) 0 nil]) ((3171 . 3172) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . 3171) (3170 . 3171) (3164 . 3170) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 3164) (3158 . 3164) (3157 . 3159) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . -3157) (3157 . 3158) (3156 . 3158) (#("(" 0 1 (fontified nil)) . -3156) (3149 . 3157) (3148 . 3149) (t 23089 29287 190301 357000) 3117) nil (23090 44111 3457 521000) 0 nil]) nil nil (23090 44111 3459 105000) 0 nil] #1# 2687 4 nil] \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ca6956 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +.*.*\~ diff --git a/README.md b/README.md index 075185c..f885c33 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ # Ponz.io -Building Ponz.io, with its endearingly upside-down-triangle-shaped business model. + +Ponz.io is a sample social networking app, and totally not a ponzi scheme, which lets users track how many other people they have signed up or "ponzverted". + +1. Clone this repo. Running the following command from the terminal should accomplish this: + + git clone https://github.com/GeneTinderholm/project_ponz + +2. Install modules. This can be done by running the following command from the terminal inside the main project folder: + + npm i + +3. Install mongodb. + +Optional step: If you wish to use the store functionality, you must create a database of objects to buy with your "Ponz Pointz". I have included an initial package of cereal images to help you get started. + +4. Run the app. This can be done by running the following command from the terminal inside the main project folder: + + node app.js + +5. Navigate to [http://localhost:3000](http://localhost:3000) in your browser. + +If you are not logged in, you will be greeted with a log in page. Input your name and password and click the "Log In" button. If you do not have an account, click the "Or Sign Up" link. Then input the desired name and password and click the "Sign Up" button. Then log in as normal. + +You should be greeted with a page that looks like the following: + +![Main](https://github.com/GeneTinderholm/project_ponz/blob/master/images/main.png?raw=true) + +On top is your referal link. Anyone who signs up with this link will be credited to your account. + +Below that is a tree of your "Ponzverts" as well as those that your Ponzverts have Ponzverted. + +It should look something like: + +![Tree](https://github.com/GeneTinderholm/project_ponz/blob/master/images/ponzTree.png?raw=true) + +Beside the name of each person is a green badge representing how many Ponz Pointz were credited to your account when they signed up. + +Below the tree is the "Pyramid of Opportunity". The top level represents you. The second level represents those you have directly ponzverted. The third level represents those that your Ponzverts have ponzverted and so on. It will continue to grow as new members join your network. + +It should look something like: + +![Pyramid](https://github.com/GeneTinderholm/project_ponz/blob/master/images/pyramid.png?raw=true) + +#####Optional Content + +If you set up a database of items to purchase, you can use your Ponz Points to buy items from the integrated store. There is no way to return items, spent Ponz Pointz are gone forever so be careful. + +If it is set up, it will look something like this: + +![Shop](https://github.com/GeneTinderholm/project_ponz/blob/master/images/cereal.png?raw=true) + +Clicking the blue "Buy" button will, if you have enough points, spend your points and display a humorous message. diff --git a/app.js b/app.js new file mode 100644 index 0000000..f7e62dd --- /dev/null +++ b/app.js @@ -0,0 +1,185 @@ +const express = require("express"); +const app = express(); + + +// ---------------------------------------- +// App Variables +// ---------------------------------------- +app.locals.appName = "Ponz"; + +// ---------------------------------------- +// ENV +// ---------------------------------------- +if (process.env.NODE_ENV !== "production") { + require("dotenv").config(); +} + +// ---------------------------------------- +// Body Parser +// ---------------------------------------- +const bodyParser = require("body-parser"); +app.use(bodyParser.urlencoded({ extended: true })); + +// ---------------------------------------- +// Sessions/Cookies +// ---------------------------------------- +const cookieSession = require("cookie-session"); + +app.use( + cookieSession({ + name: "session", + keys: [process.env.SESSION_SECRET || "secret"] + }) +); + +app.use((req, res, next) => { + res.locals.session = req.session; + next(); +}); + +// ---------------------------------------- +// Flash Messages +// ---------------------------------------- +const flash = require("express-flash-messages"); +app.use(flash()); + +// ---------------------------------------- +// Method Override +// ---------------------------------------- +const methodOverride = require("method-override"); +const getPostSupport = require("express-method-override-get-post-support"); + +app.use( + methodOverride( + getPostSupport.callback, + getPostSupport.options // { methods: ['POST', 'GET'] } + ) +); + +// ---------------------------------------- +// Referrer +// ---------------------------------------- +app.use((req, res, next) => { + req.session.backUrl = req.header("Referer") || "/"; + next(); +}); + +// ---------------------------------------- +// Public +// ---------------------------------------- +app.use(express.static(`${__dirname}/public`)); + +// ---------------------------------------- +// Logging +// ---------------------------------------- +const morgan = require("morgan"); +const morganToolkit = require("morgan-toolkit")(morgan); + +app.use(morganToolkit()); + +// ---------------------------------------- +// Routes +// ---------------------------------------- +// require Passport and the Local Strategy +const passport = require("passport"); +app.use(passport.initialize()); +app.use(passport.session()); + +const User = require("./models/User"); +const Cereal = require('./models/Cereal'); +const mongoose = require("mongoose"); +mongoose.connect("mongodb://localhost/project_ponz_development"); + +// 2 +const LocalStrategy = require("passport-local").Strategy; + +// 3 +passport.use( + new LocalStrategy(function(username, password, done) { + User.findOne({ username }, function(err, user) { + console.log(user); + if (err) return done(err); + if (!user || !user.validPassword(password)) { + return done(null, false, { message: "Invalid username/password" }); + } + return done(null, user); + }); + }) +); + +//4 +passport.serializeUser(function(user, done) { + done(null, user.id); +}); + +passport.deserializeUser(function(id, done) { + User.findById(id, function(err, user) { + done(err, user); + }); +}); + +app.use((req, res, next) => { + if (mongoose.connection.readyState) { + next(); + console.log('here'); + } else { + require('./mongo')().then(() => next()); + console.log('there'); + } +}); + + +const home = require("./routers/home"); +const ponzvert = require("./routers/ponzvert"); +const shop = require("./routers/shop"); +app.use("/", home); +app.use("/ponzvert", ponzvert); +app.use("/shop", shop); + +// ---------------------------------------- +// Template Engine +// ---------------------------------------- +const expressHandlebars = require("express-handlebars"); +const helpers = require("./helpers"); + +const hbs = expressHandlebars.create({ + helpers: helpers, + partialsDir: "views/", + defaultLayout: "application" +}); + +app.engine("handlebars", hbs.engine); +app.set("view engine", "handlebars"); + +// ---------------------------------------- +// Server +// ---------------------------------------- +const port = process.env.PORT || process.argv[2] || 3000; +const host = "localhost"; + +let args; +process.env.NODE_ENV === "production" ? (args = [port]) : (args = [port, host]); + +args.push(() => { + console.log(`Listening: http://${host}:${port}\n`); +}); + +if (require.main === module) { + app.listen.apply(app, args); +} + +// ---------------------------------------- +// Error Handling +// ---------------------------------------- +app.use((err, req, res, next) => { + if (res.headersSent) { + return next(err); + } + + if (err.stack) { + err = err.stack; + } + res.status(500).render("errors/500", { error: err }); +}); + +module.exports = app; diff --git a/config/.keep b/config/.keep new file mode 100644 index 0000000..4f07f1c --- /dev/null +++ b/config/.keep @@ -0,0 +1 @@ +.keep \ No newline at end of file diff --git a/config/mongo.json b/config/mongo.json new file mode 100644 index 0000000..73b0ac9 --- /dev/null +++ b/config/mongo.json @@ -0,0 +1,13 @@ +{ + "development": { + "database": "project_ponz_development", + "host": "localhost" + }, + "test": { + "database": "project_ponz_test", + "host": "localhost" + }, + "production": { + "use_env_variable": "MONGODB_URI" + } +} diff --git a/debug.txt b/debug.txt new file mode 100644 index 0000000..279f564 --- /dev/null +++ b/debug.txt @@ -0,0 +1,969 @@ +[33m[nodemon] 1.12.1[39m +[33m[nodemon] to restart at any time, enter `rs`[39m +[33m[nodemon] watching: *.*[39m +[32m[nodemon] starting `node app.js`[39m +Listening: http://localhost:3000 + +**** +GET / 302 56 - 7.152 ms + +Query: {} +Params: {} +Body: {} +Session: { + "backUrl": "/" +} +**** + + +**** +GET /login 200 3183 - 58.604 ms + +Query: {} +Params: {} +Body: {} +Session: { + "backUrl": "/", + "flash": {} +} +**** + + +**** +GET /register 200 3185 - 19.282 ms + +Query: {} +Params: {} +Body: {} +Session: { + "backUrl": "http://localhost:3000/login", + "flash": {} +} +**** + + +======================================== { username: 'test4', password: 'test4' } +======================================== IncomingMessage { + _readableState: + ReadableState { + objectMode: false, + highWaterMark: 16384, + buffer: BufferList { head: null, tail: null, length: 0 }, + length: 0, + pipes: null, + pipesCount: 0, + flowing: true, + ended: true, + endEmitted: true, + reading: false, + sync: false, + needReadable: false, + emittedReadable: false, + readableListening: false, + resumeScheduled: false, + destroyed: false, + defaultEncoding: 'utf8', + awaitDrain: 0, + readingMore: false, + decoder: null, + encoding: null }, + readable: false, + domain: null, + _events: {}, + _eventsCount: 0, + _maxListeners: undefined, + socket: + Socket { + connecting: false, + _hadError: false, + _handle: + TCP { + reading: true, + owner: [Circular], + onread: [Function: onread], + onconnection: null, + writeQueueSize: 0, + _consumed: true }, + _parent: null, + _host: null, + _readableState: + ReadableState { + objectMode: false, + highWaterMark: 16384, + buffer: [BufferList], + length: 0, + pipes: null, + pipesCount: 0, + flowing: true, + ended: false, + endEmitted: false, + reading: true, + sync: false, + needReadable: true, + emittedReadable: false, + readableListening: false, + resumeScheduled: false, + destroyed: false, + defaultEncoding: 'utf8', + awaitDrain: 0, + readingMore: false, + decoder: null, + encoding: null }, + readable: true, + domain: null, + _events: + { end: [Array], + finish: [Function: onSocketFinish], + _socketEnd: [Function: onSocketEnd], + drain: [Array], + timeout: [Function: socketOnTimeout], + data: [Function: bound socketOnData], + error: [Array], + close: [Array], + resume: [Function: onSocketResume], + pause: [Function: onSocketPause] }, + _eventsCount: 10, + _maxListeners: undefined, + _writableState: + WritableState { + objectMode: false, + highWaterMark: 16384, + finalCalled: false, + needDrain: false, + ending: false, + ended: false, + finished: false, + destroyed: false, + decodeStrings: false, + defaultEncoding: 'utf8', + length: 0, + writing: false, + corked: 0, + sync: true, + bufferProcessing: false, + onwrite: [Function: bound onwrite], + writecb: null, + writelen: 0, + bufferedRequest: null, + lastBufferedRequest: null, + pendingcb: 0, + prefinished: false, + errorEmitted: false, + bufferedRequestCount: 0, + corkedRequestsFree: [Object] }, + writable: true, + allowHalfOpen: true, + _bytesDispatched: 0, + _sockname: null, + _pendingData: null, + _pendingEncoding: '', + server: + Server { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + _connections: 1, + _handle: [TCP], + _usingWorkers: false, + _workers: [], + _unref: false, + allowHalfOpen: true, + pauseOnConnect: false, + httpAllowHalfOpen: false, + timeout: 120000, + keepAliveTimeout: 5000, + _pendingResponseData: 0, + maxHeadersCount: null, + _connectionKey: '4:127.0.0.1:3000', + [Symbol(asyncId)]: 15 }, + _server: + Server { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + _connections: 1, + _handle: [TCP], + _usingWorkers: false, + _workers: [], + _unref: false, + allowHalfOpen: true, + pauseOnConnect: false, + httpAllowHalfOpen: false, + timeout: 120000, + keepAliveTimeout: 5000, + _pendingResponseData: 0, + maxHeadersCount: null, + _connectionKey: '4:127.0.0.1:3000', + [Symbol(asyncId)]: 15 }, + _idleTimeout: 120000, + _idleNext: + TimersList { + _idleNext: [Circular], + _idlePrev: [Circular], + _timer: [Timer], + _unrefed: true, + msecs: 120000, + nextTick: false }, + _idlePrev: + TimersList { + _idleNext: [Circular], + _idlePrev: [Circular], + _timer: [Timer], + _unrefed: true, + msecs: 120000, + nextTick: false }, + _idleStart: 16760, + _destroyed: false, + parser: + HTTPParser { + '0': [Function: parserOnHeaders], + '1': [Function: parserOnHeadersComplete], + '2': [Function: parserOnBody], + '3': [Function: parserOnMessageComplete], + '4': [Function: bound onParserExecute], + _headers: [], + _url: '', + _consumed: true, + socket: [Circular], + incoming: [Circular], + outgoing: null, + maxHeaderPairs: 2000, + onIncoming: [Function: bound parserOnIncoming] }, + on: [Function: socketOnWrap], + _paused: false, + read: [Function], + _consuming: true, + _httpMessage: + ServerResponse { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + output: [], + outputEncodings: [], + outputCallbacks: [], + outputSize: 0, + writable: true, + _last: false, + upgrading: false, + chunkedEncoding: false, + shouldKeepAlive: true, + useChunkedEncodingByDefault: true, + sendDate: true, + _removedConnection: false, + _removedContLen: false, + _removedTE: false, + _contentLength: null, + _hasBody: true, + _trailer: '', + finished: false, + _headerSent: false, + socket: [Circular], + connection: [Circular], + _header: null, + _onPendingData: [Function: bound updateOutgoingData], + _sent100: false, + _expect_continue: false, + req: [Circular], + locals: [Object], + writeHead: [Function: writeHead], + _startAt: undefined, + _startTime: undefined, + __onFinished: [Function], + [Symbol(outHeadersKey)]: [Object] }, + _peername: { address: '127.0.0.1', family: 'IPv4', port: 52776 }, + [Symbol(asyncId)]: 225, + [Symbol(bytesRead)]: 0, + [Symbol(asyncId)]: 226, + [Symbol(triggerAsyncId)]: 15 }, + connection: + Socket { + connecting: false, + _hadError: false, + _handle: + TCP { + reading: true, + owner: [Circular], + onread: [Function: onread], + onconnection: null, + writeQueueSize: 0, + _consumed: true }, + _parent: null, + _host: null, + _readableState: + ReadableState { + objectMode: false, + highWaterMark: 16384, + buffer: [BufferList], + length: 0, + pipes: null, + pipesCount: 0, + flowing: true, + ended: false, + endEmitted: false, + reading: true, + sync: false, + needReadable: true, + emittedReadable: false, + readableListening: false, + resumeScheduled: false, + destroyed: false, + defaultEncoding: 'utf8', + awaitDrain: 0, + readingMore: false, + decoder: null, + encoding: null }, + readable: true, + domain: null, + _events: + { end: [Array], + finish: [Function: onSocketFinish], + _socketEnd: [Function: onSocketEnd], + drain: [Array], + timeout: [Function: socketOnTimeout], + data: [Function: bound socketOnData], + error: [Array], + close: [Array], + resume: [Function: onSocketResume], + pause: [Function: onSocketPause] }, + _eventsCount: 10, + _maxListeners: undefined, + _writableState: + WritableState { + objectMode: false, + highWaterMark: 16384, + finalCalled: false, + needDrain: false, + ending: false, + ended: false, + finished: false, + destroyed: false, + decodeStrings: false, + defaultEncoding: 'utf8', + length: 0, + writing: false, + corked: 0, + sync: true, + bufferProcessing: false, + onwrite: [Function: bound onwrite], + writecb: null, + writelen: 0, + bufferedRequest: null, + lastBufferedRequest: null, + pendingcb: 0, + prefinished: false, + errorEmitted: false, + bufferedRequestCount: 0, + corkedRequestsFree: [Object] }, + writable: true, + allowHalfOpen: true, + _bytesDispatched: 0, + _sockname: null, + _pendingData: null, + _pendingEncoding: '', + server: + Server { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + _connections: 1, + _handle: [TCP], + _usingWorkers: false, + _workers: [], + _unref: false, + allowHalfOpen: true, + pauseOnConnect: false, + httpAllowHalfOpen: false, + timeout: 120000, + keepAliveTimeout: 5000, + _pendingResponseData: 0, + maxHeadersCount: null, + _connectionKey: '4:127.0.0.1:3000', + [Symbol(asyncId)]: 15 }, + _server: + Server { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + _connections: 1, + _handle: [TCP], + _usingWorkers: false, + _workers: [], + _unref: false, + allowHalfOpen: true, + pauseOnConnect: false, + httpAllowHalfOpen: false, + timeout: 120000, + keepAliveTimeout: 5000, + _pendingResponseData: 0, + maxHeadersCount: null, + _connectionKey: '4:127.0.0.1:3000', + [Symbol(asyncId)]: 15 }, + _idleTimeout: 120000, + _idleNext: + TimersList { + _idleNext: [Circular], + _idlePrev: [Circular], + _timer: [Timer], + _unrefed: true, + msecs: 120000, + nextTick: false }, + _idlePrev: + TimersList { + _idleNext: [Circular], + _idlePrev: [Circular], + _timer: [Timer], + _unrefed: true, + msecs: 120000, + nextTick: false }, + _idleStart: 16760, + _destroyed: false, + parser: + HTTPParser { + '0': [Function: parserOnHeaders], + '1': [Function: parserOnHeadersComplete], + '2': [Function: parserOnBody], + '3': [Function: parserOnMessageComplete], + '4': [Function: bound onParserExecute], + _headers: [], + _url: '', + _consumed: true, + socket: [Circular], + incoming: [Circular], + outgoing: null, + maxHeaderPairs: 2000, + onIncoming: [Function: bound parserOnIncoming] }, + on: [Function: socketOnWrap], + _paused: false, + read: [Function], + _consuming: true, + _httpMessage: + ServerResponse { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + output: [], + outputEncodings: [], + outputCallbacks: [], + outputSize: 0, + writable: true, + _last: false, + upgrading: false, + chunkedEncoding: false, + shouldKeepAlive: true, + useChunkedEncodingByDefault: true, + sendDate: true, + _removedConnection: false, + _removedContLen: false, + _removedTE: false, + _contentLength: null, + _hasBody: true, + _trailer: '', + finished: false, + _headerSent: false, + socket: [Circular], + connection: [Circular], + _header: null, + _onPendingData: [Function: bound updateOutgoingData], + _sent100: false, + _expect_continue: false, + req: [Circular], + locals: [Object], + writeHead: [Function: writeHead], + _startAt: undefined, + _startTime: undefined, + __onFinished: [Function], + [Symbol(outHeadersKey)]: [Object] }, + _peername: { address: '127.0.0.1', family: 'IPv4', port: 52776 }, + [Symbol(asyncId)]: 225, + [Symbol(bytesRead)]: 0, + [Symbol(asyncId)]: 226, + [Symbol(triggerAsyncId)]: 15 }, + httpVersionMajor: 1, + httpVersionMinor: 1, + httpVersion: '1.1', + complete: true, + headers: + { host: 'localhost:3000', + connection: 'keep-alive', + 'content-length': '29', + 'cache-control': 'max-age=0', + origin: 'http://localhost:3000', + 'upgrade-insecure-requests': '1', + 'user-agent': 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36', + 'content-type': 'application/x-www-form-urlencoded', + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', + referer: 'http://localhost:3000/register', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + cookie: 'session=eyJiYWNrVXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwL3JlZ2lzdGVyIiwiZmxhc2giOnt9fQ==; session.sig=JMPr3VHw1D2qiBXgjT8bF1vaiXg' }, + rawHeaders: + [ 'Host', + 'localhost:3000', + 'Connection', + 'keep-alive', + 'Content-Length', + '29', + 'Cache-Control', + 'max-age=0', + 'Origin', + 'http://localhost:3000', + 'Upgrade-Insecure-Requests', + '1', + 'User-Agent', + 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36', + 'Content-Type', + 'application/x-www-form-urlencoded', + 'Accept', + 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', + 'Referer', + 'http://localhost:3000/register', + 'Accept-Encoding', + 'gzip, deflate, br', + 'Accept-Language', + 'en-US,en;q=0.9', + 'Cookie', + 'session=eyJiYWNrVXJsIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwL3JlZ2lzdGVyIiwiZmxhc2giOnt9fQ==; session.sig=JMPr3VHw1D2qiBXgjT8bF1vaiXg' ], + trailers: {}, + rawTrailers: [], + upgrade: false, + url: '/register', + method: 'POST', + statusCode: null, + statusMessage: null, + client: + Socket { + connecting: false, + _hadError: false, + _handle: + TCP { + reading: true, + owner: [Circular], + onread: [Function: onread], + onconnection: null, + writeQueueSize: 0, + _consumed: true }, + _parent: null, + _host: null, + _readableState: + ReadableState { + objectMode: false, + highWaterMark: 16384, + buffer: [BufferList], + length: 0, + pipes: null, + pipesCount: 0, + flowing: true, + ended: false, + endEmitted: false, + reading: true, + sync: false, + needReadable: true, + emittedReadable: false, + readableListening: false, + resumeScheduled: false, + destroyed: false, + defaultEncoding: 'utf8', + awaitDrain: 0, + readingMore: false, + decoder: null, + encoding: null }, + readable: true, + domain: null, + _events: + { end: [Array], + finish: [Function: onSocketFinish], + _socketEnd: [Function: onSocketEnd], + drain: [Array], + timeout: [Function: socketOnTimeout], + data: [Function: bound socketOnData], + error: [Array], + close: [Array], + resume: [Function: onSocketResume], + pause: [Function: onSocketPause] }, + _eventsCount: 10, + _maxListeners: undefined, + _writableState: + WritableState { + objectMode: false, + highWaterMark: 16384, + finalCalled: false, + needDrain: false, + ending: false, + ended: false, + finished: false, + destroyed: false, + decodeStrings: false, + defaultEncoding: 'utf8', + length: 0, + writing: false, + corked: 0, + sync: true, + bufferProcessing: false, + onwrite: [Function: bound onwrite], + writecb: null, + writelen: 0, + bufferedRequest: null, + lastBufferedRequest: null, + pendingcb: 0, + prefinished: false, + errorEmitted: false, + bufferedRequestCount: 0, + corkedRequestsFree: [Object] }, + writable: true, + allowHalfOpen: true, + _bytesDispatched: 0, + _sockname: null, + _pendingData: null, + _pendingEncoding: '', + server: + Server { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + _connections: 1, + _handle: [TCP], + _usingWorkers: false, + _workers: [], + _unref: false, + allowHalfOpen: true, + pauseOnConnect: false, + httpAllowHalfOpen: false, + timeout: 120000, + keepAliveTimeout: 5000, + _pendingResponseData: 0, + maxHeadersCount: null, + _connectionKey: '4:127.0.0.1:3000', + [Symbol(asyncId)]: 15 }, + _server: + Server { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + _connections: 1, + _handle: [TCP], + _usingWorkers: false, + _workers: [], + _unref: false, + allowHalfOpen: true, + pauseOnConnect: false, + httpAllowHalfOpen: false, + timeout: 120000, + keepAliveTimeout: 5000, + _pendingResponseData: 0, + maxHeadersCount: null, + _connectionKey: '4:127.0.0.1:3000', + [Symbol(asyncId)]: 15 }, + _idleTimeout: 120000, + _idleNext: + TimersList { + _idleNext: [Circular], + _idlePrev: [Circular], + _timer: [Timer], + _unrefed: true, + msecs: 120000, + nextTick: false }, + _idlePrev: + TimersList { + _idleNext: [Circular], + _idlePrev: [Circular], + _timer: [Timer], + _unrefed: true, + msecs: 120000, + nextTick: false }, + _idleStart: 16760, + _destroyed: false, + parser: + HTTPParser { + '0': [Function: parserOnHeaders], + '1': [Function: parserOnHeadersComplete], + '2': [Function: parserOnBody], + '3': [Function: parserOnMessageComplete], + '4': [Function: bound onParserExecute], + _headers: [], + _url: '', + _consumed: true, + socket: [Circular], + incoming: [Circular], + outgoing: null, + maxHeaderPairs: 2000, + onIncoming: [Function: bound parserOnIncoming] }, + on: [Function: socketOnWrap], + _paused: false, + read: [Function], + _consuming: true, + _httpMessage: + ServerResponse { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + output: [], + outputEncodings: [], + outputCallbacks: [], + outputSize: 0, + writable: true, + _last: false, + upgrading: false, + chunkedEncoding: false, + shouldKeepAlive: true, + useChunkedEncodingByDefault: true, + sendDate: true, + _removedConnection: false, + _removedContLen: false, + _removedTE: false, + _contentLength: null, + _hasBody: true, + _trailer: '', + finished: false, + _headerSent: false, + socket: [Circular], + connection: [Circular], + _header: null, + _onPendingData: [Function: bound updateOutgoingData], + _sent100: false, + _expect_continue: false, + req: [Circular], + locals: [Object], + writeHead: [Function: writeHead], + _startAt: undefined, + _startTime: undefined, + __onFinished: [Function], + [Symbol(outHeadersKey)]: [Object] }, + _peername: { address: '127.0.0.1', family: 'IPv4', port: 52776 }, + [Symbol(asyncId)]: 225, + [Symbol(bytesRead)]: 0, + [Symbol(asyncId)]: 226, + [Symbol(triggerAsyncId)]: 15 }, + _consuming: true, + _dumped: false, + next: [Function: next], + baseUrl: '', + originalUrl: '/register', + _parsedUrl: + Url { + protocol: null, + slashes: null, + auth: null, + host: null, + port: null, + hostname: null, + hash: null, + search: null, + query: null, + pathname: '/register', + path: '/register', + href: '/register', + _raw: '/register' }, + params: {}, + query: {}, + res: + ServerResponse { + domain: null, + _events: { finish: [Array], end: [Function: onevent] }, + _eventsCount: 2, + _maxListeners: undefined, + output: [], + outputEncodings: [], + outputCallbacks: [], + outputSize: 0, + writable: true, + _last: false, + upgrading: false, + chunkedEncoding: false, + shouldKeepAlive: true, + useChunkedEncodingByDefault: true, + sendDate: true, + _removedConnection: false, + _removedContLen: false, + _removedTE: false, + _contentLength: null, + _hasBody: true, + _trailer: '', + finished: false, + _headerSent: false, + socket: + Socket { + connecting: false, + _hadError: false, + _handle: [TCP], + _parent: null, + _host: null, + _readableState: [ReadableState], + readable: true, + domain: null, + _events: [Object], + _eventsCount: 10, + _maxListeners: undefined, + _writableState: [WritableState], + writable: true, + allowHalfOpen: true, + _bytesDispatched: 0, + _sockname: null, + _pendingData: null, + _pendingEncoding: '', + server: [Server], + _server: [Server], + _idleTimeout: 120000, + _idleNext: [TimersList], + _idlePrev: [TimersList], + _idleStart: 16760, + _destroyed: false, + parser: [HTTPParser], + on: [Function: socketOnWrap], + _paused: false, + read: [Function], + _consuming: true, + _httpMessage: [Circular], + _peername: [Object], + [Symbol(asyncId)]: 225, + [Symbol(bytesRead)]: 0, + [Symbol(asyncId)]: 226, + [Symbol(triggerAsyncId)]: 15 }, + connection: + Socket { + connecting: false, + _hadError: false, + _handle: [TCP], + _parent: null, + _host: null, + _readableState: [ReadableState], + readable: true, + domain: null, + _events: [Object], + _eventsCount: 10, + _maxListeners: undefined, + _writableState: [WritableState], + writable: true, + allowHalfOpen: true, + _bytesDispatched: 0, + _sockname: null, + _pendingData: null, + _pendingEncoding: '', + server: [Server], + _server: [Server], + _idleTimeout: 120000, + _idleNext: [TimersList], + _idlePrev: [TimersList], + _idleStart: 16760, + _destroyed: false, + parser: [HTTPParser], + on: [Function: socketOnWrap], + _paused: false, + read: [Function], + _consuming: true, + _httpMessage: [Circular], + _peername: [Object], + [Symbol(asyncId)]: 225, + [Symbol(bytesRead)]: 0, + [Symbol(asyncId)]: 226, + [Symbol(triggerAsyncId)]: 15 }, + _header: null, + _onPendingData: [Function: bound updateOutgoingData], + _sent100: false, + _expect_continue: false, + req: [Circular], + locals: { session: [Session], getMessages: [Function] }, + writeHead: [Function: writeHead], + _startAt: undefined, + _startTime: undefined, + __onFinished: { [Function: listener] queue: [Array] }, + [Symbol(outHeadersKey)]: { 'x-powered-by': [Array] } }, + body: { username: 'test4', password: 'test4' }, + _body: true, + length: undefined, + read: [Function], + sessionCookies: + Cookies { + secure: undefined, + request: [Circular], + response: + ServerResponse { + domain: null, + _events: [Object], + _eventsCount: 2, + _maxListeners: undefined, + output: [], + outputEncodings: [], + outputCallbacks: [], + outputSize: 0, + writable: true, + _last: false, + upgrading: false, + chunkedEncoding: false, + shouldKeepAlive: true, + useChunkedEncodingByDefault: true, + sendDate: true, + _removedConnection: false, + _removedContLen: false, + _removedTE: false, + _contentLength: null, + _hasBody: true, + _trailer: '', + finished: false, + _headerSent: false, + socket: [Socket], + connection: [Socket], + _header: null, + _onPendingData: [Function: bound updateOutgoingData], + _sent100: false, + _expect_continue: false, + req: [Circular], + locals: [Object], + writeHead: [Function: writeHead], + _startAt: undefined, + _startTime: undefined, + __onFinished: [Function], + [Symbol(outHeadersKey)]: [Object] }, + keys: Keygrip { sign: [Function], verify: [Function], index: [Function] } }, + sessionOptions: {}, + sessionKey: 'session', + session: [Getter/Setter], + flash: [Function: _flash], + originalMethod: 'POST', + _startAt: [ 43206, 106893619 ], + _startTime: 2017-12-13T17:21:20.185Z, + _remoteAddress: '127.0.0.1', + _passport: + { instance: + Authenticator { + _key: 'passport', + _strategies: [Object], + _serializers: [Array], + _deserializers: [Array], + _infoTransformers: [], + _framework: [Object], + _userProperty: 'user', + _sm: [SessionManager], + Authenticator: [Function: Authenticator], + Passport: [Function: Authenticator], + Strategy: [Function], + strategies: [Object] } }, + route: + Route { + path: '/register', + stack: [ [Layer] ], + methods: { post: true } } } +**** +POST /register 500 3672 - 127.470 ms + +Query: {} +Params: {} +Body: { + "username": "test4", + "password": "test4" +} +Session: { + "backUrl": "http://localhost:3000/register", + "flash": {} +} +**** + + diff --git a/helpers/application_helper.js b/helpers/application_helper.js new file mode 100644 index 0000000..6ab3bcf --- /dev/null +++ b/helpers/application_helper.js @@ -0,0 +1,19 @@ +const ApplicationHelper = {}; + + +ApplicationHelper.rootPath = () => '/'; +ApplicationHelper.CSSID = (...args) => { + let n = args.length; + let options = args[n - 1]; + let viewPath = options.data.exphbs.view; + let id = viewPath.split('/').join('-'); + return id; +}; + + +module.exports = ApplicationHelper; + + + + + diff --git a/helpers/bootstrap_helper.js b/helpers/bootstrap_helper.js new file mode 100644 index 0000000..7e1b39f --- /dev/null +++ b/helpers/bootstrap_helper.js @@ -0,0 +1,13 @@ +const BootstrapHelper = {}; + + +BootstrapHelper.glyphicon = type => { + return `` +}; + + + +module.exports = BootstrapHelper; diff --git a/helpers/flash_helper.js b/helpers/flash_helper.js new file mode 100644 index 0000000..a025dd0 --- /dev/null +++ b/helpers/flash_helper.js @@ -0,0 +1,14 @@ +const FlashHelper = {}; + + +FlashHelper.bootstrapAlertClassFor = key => { + return { + "error": "danger", + "alert": "danger", + "notice": "info" + }[key] || key; +}; + + +module.exports = FlashHelper; + diff --git a/helpers/index.js b/helpers/index.js new file mode 100644 index 0000000..aeb43ff --- /dev/null +++ b/helpers/index.js @@ -0,0 +1,9 @@ +const LoadHelpers = require('load-helpers'); +const helperLoader = new LoadHelpers(); +const helpers = helperLoader.load('helpers/*_helper.js').cache; + +module.exports = helpers; + + + + diff --git a/helpers/lodash_helper.js b/helpers/lodash_helper.js new file mode 100644 index 0000000..18364fd --- /dev/null +++ b/helpers/lodash_helper.js @@ -0,0 +1,19 @@ +const _ = require('lodash'); + + +const LodashHelper = {}; + + +LodashHelper.isEmpty = _.isEmpty; +LodashHelper.size = _.size; + + + +module.exports = LodashHelper; + + + + + + + diff --git a/helpers/math_helper.js b/helpers/math_helper.js new file mode 100644 index 0000000..aa61dab --- /dev/null +++ b/helpers/math_helper.js @@ -0,0 +1,14 @@ + +const MathHelper = {}; + + +MathHelper.add = (a, b) => a + b; +MathHelper.sub = (a, b) => a - b; +MathHelper.div = (a, b) => a / b; +MathHelper.mult = (a, b) => a * b; + + + +module.exports = MathHelper; + + diff --git a/helpers/utils_helper.js b/helpers/utils_helper.js new file mode 100644 index 0000000..db99ae3 --- /dev/null +++ b/helpers/utils_helper.js @@ -0,0 +1,93 @@ + + + +const UtilsHelper = {}; + + +UtilsHelper.concat = (...args) => args.slice(0, -1).join(''); + + +UtilsHelper.join = (str, ...args) => args.slice(0, -1).join(str); + + +UtilsHelper.debug = obj => `
${ JSON.stringify(obj, null, 2) }`; + + +UtilsHelper.json = obj => JSON.stringify(obj, null, 2); + + +UtilsHelper.eq = (a, b) => a == b; + + +UtilsHelper.eql = (a, b) => a === b; + + +UtilsHelper.gt = (a, b) => a > b; + + +UtilsHelper.gte = (a, b) => a >= b; + + +UtilsHelper.lt = (a, b) => a < b; + + +UtilsHelper.lte = (a, b) => a <= b; + + +UtilsHelper.times = function(n, options) { + if (typeof n === 'object') { + options = n; + } + + let start; + let stop; + let step; + let direction; + + if (options.hash && Object.keys(options.hash).length) { + start = options.hash.start; + stop = options.hash.stop; + step = options.hash.step; + direction = options.hash.direction; + step = step || 1; + direction = direction || 1; + } else { + start = 0; + stop = n - 1; + step = 1; + direction = 1; + } + + if (options.hash.start && + options.hash.stop) { + start = options.hash.start; + stop = options.hash.stop; + } + + let output = ''; + + for (let i = start; i <= stop; i += (step * direction)) { + output += options.fn(this, { + data: { index: i }, + blockParams: [i] + }); + } + + return output; +}; + + + +module.exports = UtilsHelper; + + + + + + + + + + + + diff --git a/images/cereal.png b/images/cereal.png new file mode 100644 index 0000000..e6b13e9 Binary files /dev/null and b/images/cereal.png differ diff --git a/images/main.png b/images/main.png new file mode 100644 index 0000000..7e1c233 Binary files /dev/null and b/images/main.png differ diff --git a/images/ponzTree.png b/images/ponzTree.png new file mode 100644 index 0000000..0368871 Binary files /dev/null and b/images/ponzTree.png differ diff --git a/images/pyramid.png b/images/pyramid.png new file mode 100644 index 0000000..51ab39d Binary files /dev/null and b/images/pyramid.png differ diff --git a/lib/.keep b/lib/.keep new file mode 100644 index 0000000..e69de29 diff --git a/models/.keep b/models/.keep new file mode 100644 index 0000000..e69de29 diff --git a/models/Cereal.js b/models/Cereal.js new file mode 100644 index 0000000..24bd01b --- /dev/null +++ b/models/Cereal.js @@ -0,0 +1,13 @@ +const mongoose = require("mongoose"); +const uniqueValidator = require("mongoose-unique-validator"); +const Schema = mongoose.Schema; + +const CerealSchema = Schema({ + name: { type: String, required: true, unique: true }, + price: { type: Number, default: 0 } +}); + + +const Cereal = mongoose.model("Cereal", CerealSchema); + +module.exports = Cereal; diff --git a/models/User.js b/models/User.js new file mode 100644 index 0000000..f355a5c --- /dev/null +++ b/models/User.js @@ -0,0 +1,31 @@ +const mongoose = require("mongoose"); +const bcrypt = require("bcrypt"); +const uniqueValidator = require("mongoose-unique-validator"); +const Schema = mongoose.Schema; + +const UserSchema = Schema({ + username: { type: String, required: true, unique: true }, + passwordHash: { type: String, required: true }, + date: { type: Date, default: Date.now }, + referrer: { type: Schema.Types.ObjectId, ref: "User" }, + pointsSpent: { type: Number, default: 0 } +}); + +UserSchema.plugin(uniqueValidator); + +UserSchema.methods.validPassword = function(password) { + return bcrypt.compareSync(password, this.passwordHash); +}; + +UserSchema.virtual("password") + .get(function() { + return this._password; + }) + .set(function(value) { + this._password = value; + this.passwordHash = bcrypt.hashSync(value, 8); + }); + +const User = mongoose.model("User", UserSchema); + +module.exports = User; diff --git a/models/index.js b/models/index.js new file mode 100644 index 0000000..e48dacd --- /dev/null +++ b/models/index.js @@ -0,0 +1,11 @@ +let mongoose = require('mongoose'); +let bluebird = require('bluebird'); + +mongoose.Promise = bluebird; + +let models = {}; + +models.User = require('./User'); +models.Cereal = require('./Cereal'); + +module.exports = models; diff --git a/mongo.js b/mongo.js new file mode 100644 index 0000000..72563a5 --- /dev/null +++ b/mongo.js @@ -0,0 +1,11 @@ +let mongoose = require('mongoose'); +let env = process.env.NODE_ENV || 'development'; +let config = require('./config/mongo')[env]; + +module.exports = () => { + let envUrl = process.env[config.use_env_variable]; + let localUrl = `mongodb://${config.host}/${config.database}`; + let mongoUrl = envUrl ? envUrl : localUrl; + return mongoose.connect(mongoUrl); +}; + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f0d0c22 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2338 @@ +{ + "name": "project_ponz", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.0.58", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.58.tgz", + "integrity": "sha512-V746iUU7eHNdzQipoACuguDlVhC7IHK8CES1jSkuFt352wwA84BCWPXaGekBd7R5XdNK5ReHONDVKxlL9IreAw==" + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, + "ajv": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.1.tgz", + "integrity": "sha1-s4u4h22ehr7plJVqBOch6IskjrI=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "requires": { + "color-convert": "1.9.1" + } + }, + "any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.7" + } + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "async-array-reduce": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/async-array-reduce/-/async-array-reduce-0.2.1.tgz", + "integrity": "sha1-yL4BCitc0A3qlsgRFgNGk9/dgtE=" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "basic-auth": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", + "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "bcrypt": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-1.0.3.tgz", + "integrity": "sha512-pRyDdo73C8Nim3jwFJ7DWe3TZCgwDfWZ6nHS5LSdU77kWbj1frruvdndP02AOavtD4y8v6Fp2dolbHgp4SDrfg==", + "requires": { + "nan": "2.6.2", + "node-pre-gyp": "0.6.36" + } + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "requires": { + "inherits": "2.0.3" + } + }, + "bluebird": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.1", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.15" + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "requires": { + "hoek": "4.2.0" + } + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "bson": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", + "integrity": "sha1-k8ENOeqltYQVy8QFLz5T5WKwtyw=" + }, + "buffer-shims": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "optional": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "cli-highlight": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-1.2.3.tgz", + "integrity": "sha512-cmc4Y2kJuEpT2KZd9pgWWskpDMMfJu2roIcY1Ya/aIItufF5FKsV/NtA6vvdhSUllR8KJfvQDNmIcskU+MKLDg==", + "requires": { + "chalk": "2.3.0", + "highlight.js": "9.12.0", + "mz": "2.7.0", + "parse5": "3.0.3", + "yargs": "10.0.3" + }, + "dependencies": { + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "yargs": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.0.3.tgz", + "integrity": "sha512-DqBpQ8NAUX4GyPP/ijDGHsJya4tYqLQrjPr95HNsr1YwL3+daCfvBwg7+gIC6IdJhR2kATh3hb61vjzMWEtjdw==", + "requires": { + "cliui": "3.2.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "8.0.0" + } + } + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "optional": true + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-parser": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz", + "integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6" + } + }, + "cookie-session": { + "version": "2.0.0-beta.3", + "resolved": "https://registry.npmjs.org/cookie-session/-/cookie-session-2.0.0-beta.3.tgz", + "integrity": "sha512-zyqm5tA0z9yMEB/xyP7lnRnqp8eLR2e0dap+9+rBwVigla9yPKn8XTL1jJymog8xjfrowqW2o5LUjixQChkqrw==", + "requires": { + "cookies": "0.7.1", + "debug": "3.1.0", + "on-headers": "1.0.1", + "safe-buffer": "5.1.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cookies": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.1.tgz", + "integrity": "sha1-fIphX1SBxhq58WyDNzG8uPZjuZs=", + "requires": { + "depd": "1.1.1", + "keygrip": "1.0.2" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.0" + } + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + }, + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "dotenv": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-4.0.0.tgz", + "integrity": "sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=" + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" + }, + "es6-promise": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", + "integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "expand-tilde": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", + "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "requires": { + "os-homedir": "1.0.2" + } + }, + "express": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", + "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.1", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.0", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.2", + "qs": "6.5.1", + "range-parser": "1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.1", + "serve-static": "1.13.1", + "setprototypeof": "1.1.0", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "express-flash-messages": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/express-flash-messages/-/express-flash-messages-0.1.1.tgz", + "integrity": "sha1-QCDOUXjDuzZjlN6QZiILwnBb1vI=" + }, + "express-handlebars": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/express-handlebars/-/express-handlebars-3.0.0.tgz", + "integrity": "sha1-gKBwu4GbCeSvLKbQeA91zgXnXC8=", + "requires": { + "glob": "6.0.4", + "graceful-fs": "4.1.11", + "handlebars": "4.0.11", + "object.assign": "4.0.4", + "promise": "7.3.1" + } + }, + "express-method-override-get-post-support": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/express-method-override-get-post-support/-/express-method-override-get-post-support-1.0.0.tgz", + "integrity": "sha512-uBS1tJsdoRgTa3ujiJRXC1z6haAdSccZs1tH0a4NTpm9dm598xgM/C7rg+x3qPf14GLQf90h6ltsQ4x68zkt/Q==" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "2.0.0" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "integrity": "sha1-nDHa40dnAY/h0kmyTa2mfQktoQU=", + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "global-modules": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "requires": { + "global-prefix": "0.1.5", + "is-windows": "0.2.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "requires": { + "homedir-polyfill": "1.0.1", + "ini": "1.3.5", + "is-windows": "0.2.0", + "which": "1.3.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.5.1", + "har-schema": "2.0.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "has-glob": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/has-glob/-/has-glob-0.1.1.tgz", + "integrity": "sha1-omHEwqbGZ+DHe3AKfyl8Oe86pYk=", + "requires": { + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.0", + "sntp": "2.1.0" + } + }, + "highlight.js": { + "version": "9.12.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz", + "integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4=" + }, + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hooks-fixed": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.2.tgz", + "integrity": "sha512-YurCM4gQSetcrhwEtpQHhQ4M7Zo7poNGqY4kQGeBS6eZtOcT3tnNs01ThFa0jYBByAiYt1MjMjP/YApG0EnAvQ==" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "ipaddr.js": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", + "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=" + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "3.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-valid-glob": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", + "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=" + }, + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kareem": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz", + "integrity": "sha1-4+QQHZ3P3imXadr0tNtk2JXRdEg=" + }, + "keygrip": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.2.tgz", + "integrity": "sha1-rTKXxVcGneqLz+ek+kkbdcXd65E=" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "load-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/load-helpers/-/load-helpers-1.0.1.tgz", + "integrity": "sha1-ZoEbwF/PBwSO9w9lRzC0Ip5qrLM=", + "requires": { + "component-emitter": "1.2.1", + "extend-shallow": "2.0.1", + "is-glob": "3.1.0", + "is-valid-glob": "0.3.0", + "kind-of": "3.2.2", + "matched": "0.4.4", + "resolve-dir": "0.1.1", + "set-value": "0.4.3" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + }, + "lodash.foreach": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", + "integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "matched": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/matched/-/matched-0.4.4.tgz", + "integrity": "sha1-Vte36xgDPwz5vFLrIJD6x9weifo=", + "requires": { + "arr-union": "3.1.0", + "async-array-reduce": "0.2.1", + "extend-shallow": "2.0.1", + "fs-exists-sync": "0.1.0", + "glob": "7.1.2", + "has-glob": "0.1.1", + "is-valid-glob": "0.3.0", + "lazy-cache": "2.0.2", + "resolve-dir": "0.1.1" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "lazy-cache": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-2.0.2.tgz", + "integrity": "sha1-uRkKT5EzVGlIQIWfio9whNiCImQ=", + "requires": { + "set-getter": "0.1.0" + } + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "1.1.0" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "method-override": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/method-override/-/method-override-2.3.10.tgz", + "integrity": "sha1-49r41d7hDdLc59SuiNYrvud0drQ=", + "requires": { + "debug": "2.6.9", + "methods": "1.1.2", + "parseurl": "1.3.2", + "vary": "1.1.2" + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "1.30.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + }, + "mongodb": { + "version": "2.2.33", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.33.tgz", + "integrity": "sha1-tTfEcdNKZlG0jzb9vyl1A0Dgi1A=", + "requires": { + "es6-promise": "3.2.1", + "mongodb-core": "2.1.17", + "readable-stream": "2.2.7" + } + }, + "mongodb-core": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.17.tgz", + "integrity": "sha1-pBizN6FKFJkPtRC5I97mqBMXPfg=", + "requires": { + "bson": "1.0.4", + "require_optional": "1.0.1" + } + }, + "mongoose": { + "version": "4.13.7", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.13.7.tgz", + "integrity": "sha512-3VPcGQWaTzT/OVK+TpE9dGpNHBnEqFX2RmbFr1XvbsKmxPsL9kaRBSHqaQ8QEMd6CUeOYMRdH1pKRrlnCenRsg==", + "requires": { + "async": "2.1.4", + "bson": "1.0.4", + "hooks-fixed": "2.0.2", + "kareem": "1.5.0", + "lodash.get": "4.4.2", + "mongodb": "2.2.33", + "mpath": "0.3.0", + "mpromise": "0.5.5", + "mquery": "2.3.3", + "ms": "2.0.0", + "muri": "1.3.0", + "regexp-clone": "0.0.1", + "sliced": "1.0.1" + }, + "dependencies": { + "async": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", + "integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=", + "requires": { + "lodash": "4.17.4" + } + } + } + }, + "mongoose-unique-validator": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/mongoose-unique-validator/-/mongoose-unique-validator-1.0.6.tgz", + "integrity": "sha512-hJf1eiWPw9O5ed7HUtFHtHhqnWDpm42Q5iC3xs6p99kr1qrVMq8WR2x+yobx6rY5F26Ki2NqGvJTe8v/Fax0kw==", + "requires": { + "lodash.foreach": "4.5.0", + "lodash.get": "4.4.2" + } + }, + "morgan": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", + "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", + "requires": { + "basic-auth": "2.0.0", + "debug": "2.6.9", + "depd": "1.1.1", + "on-finished": "2.3.0", + "on-headers": "1.0.1" + } + }, + "morgan-toolkit": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/morgan-toolkit/-/morgan-toolkit-1.0.2.tgz", + "integrity": "sha512-tFhfamRSNrnGlaVfY384lFyeHZl8Y4IwSt2219+6YEuVeEJKVBlAQHT/NSAF5hlHrloI0G578zRy0Hxv4Iv10Q==", + "requires": { + "chalk": "2.3.0", + "cli-highlight": "1.2.3" + } + }, + "mpath": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz", + "integrity": "sha1-elj3iem1/TyUUgY0FXlg8mvV70Q=" + }, + "mpromise": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz", + "integrity": "sha1-9bJCWddjrMIlewoMjG2Gb9UXMuY=" + }, + "mquery": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-2.3.3.tgz", + "integrity": "sha512-NC8L14kn+qxJbbJ1gbcEMDxF0sC3sv+1cbRReXXwVvowcwY1y9KoVZFq0ebwARibsadu8lx8nWGvm3V0Pf0ZWQ==", + "requires": { + "bluebird": "3.5.0", + "debug": "2.6.9", + "regexp-clone": "0.0.1", + "sliced": "0.0.5" + }, + "dependencies": { + "sliced": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", + "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "muri": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/muri/-/muri-1.3.0.tgz", + "integrity": "sha512-FiaFwKl864onHFFUV/a2szAl7X0fxVlSKNdhTf+BM8i8goEgYut8u5P9MqQqIYwvaMxjzVESsoEm/2kfkFH1rg==" + }, + "mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "requires": { + "any-promise": "1.3.0", + "object-assign": "4.1.1", + "thenify-all": "1.6.0" + } + }, + "nan": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", + "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "node-pre-gyp": { + "version": "0.6.36", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz", + "integrity": "sha1-22BBEst04NR3VU6bUFsXq936t4Y=", + "requires": { + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.2", + "rc": "1.2.2", + "request": "2.83.0", + "rimraf": "2.6.2", + "semver": "5.4.1", + "tar": "2.2.1", + "tar-pack": "3.4.1" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.4" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "2.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" + }, + "object.assign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.0.4.tgz", + "integrity": "sha1-scnMBE7xuf5jYG/BQau7MuFHMMw=", + "requires": { + "define-properties": "1.1.2", + "function-bind": "1.1.1", + "object-keys": "1.0.11" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=" + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "1.1.0" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "parse5": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz", + "integrity": "sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA==", + "requires": { + "@types/node": "8.0.58" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "passport": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz", + "integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=", + "requires": { + "passport-strategy": "1.0.0", + "pause": "0.0.1" + } + }, + "passport-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz", + "integrity": "sha1-H+YyaMkudWBmJkN+O5BmYsFbpu4=", + "requires": { + "passport-strategy": "1.0.0" + } + }, + "passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "requires": { + "asap": "2.0.6" + } + }, + "proxy-addr": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", + "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.5.2" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "rc": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", + "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "readable-stream": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", + "integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=", + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "regexp-clone": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", + "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.1", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", + "requires": { + "resolve-from": "2.0.0", + "semver": "5.4.1" + } + }, + "resolve-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", + "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "requires": { + "expand-tilde": "1.2.2", + "global-modules": "0.2.3" + } + }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "7.1.2" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "send": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", + "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.1", + "destroy": "1.0.4", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" + } + } + }, + "serve-static": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", + "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "requires": { + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "set-getter": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/set-getter/-/set-getter-0.1.0.tgz", + "integrity": "sha1-12nBgsnVpR9AkUXy+6guXoboA3Y=", + "requires": { + "to-object-path": "0.3.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "requires": { + "hoek": "4.2.0" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": "1.0.1" + } + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "requires": { + "has-flag": "2.0.0" + } + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-3.4.1.tgz", + "integrity": "sha512-PPRybI9+jM5tjtCbN2cxmmRU7YmqT3Zv/UDy48tAh2XRkLa9bAORtSWLkVc13+GJF+cdTh1yEnHEk3cpTaL5Kg==", + "requires": { + "debug": "2.6.9", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.7", + "rimraf": "2.6.2", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "thenify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", + "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", + "requires": { + "any-promise": "1.3.0" + } + }, + "thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", + "requires": { + "thenify": "3.3.0" + } + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "3.2.2" + } + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.17" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "optional": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", + "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "requires": { + "string-width": "1.0.2" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + }, + "yargs-parser": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.0.0.tgz", + "integrity": "sha1-IdR2Mw5agieaS4gTRb8GYQLiGcY=", + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + } + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..00763f7 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "project_ponz", + "version": "1.0.0", + "description": "Building Ponz.io, with its endearingly upside-down-triangle-shaped business model.", + "main": "app.js", + "directories": { + "lib": "lib" + }, + "dependencies": { + "bcrypt": "^1.0.3", + "body-parser": "^1.18.2", + "cookie-parser": "^1.4.3", + "cookie-session": "^2.0.0-beta.3", + "dotenv": "^4.0.0", + "express": "^4.16.2", + "express-flash-messages": "^0.1.1", + "express-handlebars": "^3.0.0", + "express-method-override-get-post-support": "^1.0.0", + "load-helpers": "^1.0.1", + "lodash": "^4.17.4", + "method-override": "^2.3.10", + "mongoose": "^4.13.7", + "mongoose-unique-validator": "^1.0.6", + "morgan": "^1.9.0", + "morgan-toolkit": "^1.0.2", + "passport": "^0.4.0", + "passport-local": "^1.0.0" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/GeneTinderholm/project_ponz.git" + }, + "author": "Gene Tinderholm", + "license": "ISC", + "bugs": { + "url": "https://github.com/GeneTinderholm/project_ponz/issues" + }, + "homepage": "https://github.com/GeneTinderholm/project_ponz#readme" +} diff --git a/public/assets/stylesheets/css/style.css b/public/assets/stylesheets/css/style.css new file mode 100644 index 0000000..e69de29 diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..1645651 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/images/5a32c4dcc34b2a0c155e5429.jpg b/public/images/5a32c4dcc34b2a0c155e5429.jpg new file mode 100644 index 0000000..d361367 Binary files /dev/null and b/public/images/5a32c4dcc34b2a0c155e5429.jpg differ diff --git a/public/images/5a32c518c34b2a0c155e542a.jpg b/public/images/5a32c518c34b2a0c155e542a.jpg new file mode 100644 index 0000000..48f3b70 Binary files /dev/null and b/public/images/5a32c518c34b2a0c155e542a.jpg differ diff --git a/public/images/5a32c542c34b2a0c155e542b.jpg b/public/images/5a32c542c34b2a0c155e542b.jpg new file mode 100644 index 0000000..4c2327e Binary files /dev/null and b/public/images/5a32c542c34b2a0c155e542b.jpg differ diff --git a/public/images/5a32c56ac34b2a0c155e542c.jpg b/public/images/5a32c56ac34b2a0c155e542c.jpg new file mode 100644 index 0000000..e0700d5 Binary files /dev/null and b/public/images/5a32c56ac34b2a0c155e542c.jpg differ diff --git a/public/images/5a32c585c34b2a0c155e542d.jpg b/public/images/5a32c585c34b2a0c155e542d.jpg new file mode 100644 index 0000000..191f367 Binary files /dev/null and b/public/images/5a32c585c34b2a0c155e542d.jpg differ diff --git a/public/images/5a32c59fc34b2a0c155e542e.jpg b/public/images/5a32c59fc34b2a0c155e542e.jpg new file mode 100644 index 0000000..60297d8 Binary files /dev/null and b/public/images/5a32c59fc34b2a0c155e542e.jpg differ diff --git a/public/images/5a32c5b8c34b2a0c155e542f.jpg b/public/images/5a32c5b8c34b2a0c155e542f.jpg new file mode 100644 index 0000000..a2e8633 Binary files /dev/null and b/public/images/5a32c5b8c34b2a0c155e542f.jpg differ diff --git a/public/images/5a32c5cfc34b2a0c155e5430.jpg b/public/images/5a32c5cfc34b2a0c155e5430.jpg new file mode 100644 index 0000000..63f8d6a Binary files /dev/null and b/public/images/5a32c5cfc34b2a0c155e5430.jpg differ diff --git a/public/images/cereal9.jpg b/public/images/cereal9.jpg new file mode 100644 index 0000000..543e98a Binary files /dev/null and b/public/images/cereal9.jpg differ diff --git a/repl.js b/repl.js new file mode 100644 index 0000000..664c14f --- /dev/null +++ b/repl.js @@ -0,0 +1,12 @@ +let mongoose = require('mongoose'); +let repl = require('repl').start({}); +let models = require('./models/'); + +require('./mongo')().then(() => { + repl.context.models = models; + Object.keys(models).forEach(modelName => { + repl.context[modelName] = mongoose.model(modelName); + }); + + repl.context.lg = data => console.log(data); +}); diff --git a/routers/.keep b/routers/.keep new file mode 100644 index 0000000..e69de29 diff --git a/routers/.ponzvert.js.~undo-tree~ b/routers/.ponzvert.js.~undo-tree~ new file mode 100644 index 0000000..6cfc14a --- /dev/null +++ b/routers/.ponzvert.js.~undo-tree~ @@ -0,0 +1,36 @@ +"0181eeb1d39924a1f072df7c0f538477e6deb893" +[cl-struct-undo-tree [nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil (#1=[nil nil ((734 . 779) (#(" res.redirect(`register/${req.params.id}`, ) +" 0 16 (fontified t) 16 17 (fontified t face (rainbow-delimiters-depth-3-face)) 17 26 (fontified t face font-lock-string-face) 26 28 (fontified t face font-lock-string-face) 28 29 (fontified t face font-lock-string-face) 29 42 (fontified t face font-lock-string-face) 42 43 (fontified t face font-lock-string-face) 43 44 (fontified t face font-lock-string-face) 44 46 (fontified t) 46 47 (fontified t face (rainbow-delimiters-depth-3-face)) 47 48 (fontified t)) . 734) (undo-tree-id140 . -8) (undo-tree-id141 . 22) (undo-tree-id142 . -8) (undo-tree-id143 . 32) (undo-tree-id144 . -8) (undo-tree-id145 . -8) (undo-tree-id146 . -48) (undo-tree-id147 . -48) (undo-tree-id148 . 23) (undo-tree-id149 . 23) (undo-tree-id150 . -25) (undo-tree-id151 . -25) (undo-tree-id152 . -25) (undo-tree-id153 . -48)) nil (23089 24232 444455 444000) 0 nil]) ((752 . 760) (#("login" 0 5 (fontified t face font-lock-string-face)) . 752)) nil (23089 24232 444459 183000) 0 nil]) ((774 . 775) (751 . 752) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 773) (#("'" 0 1 (fontified t face font-lock-string-face)) . 751) 768) nil (23089 24232 444461 416000) 0 nil]) ((760 . 773) (#("}" 0 1 (fontified nil face font-lock-string-face)) . 761) (760 . 761) (759 . 761) (#("{" 0 1 (fontified nil face font-lock-string-face)) . -759) (758 . 760) (#("E" 0 1 (fontified t face font-lock-string-face)) . -758) (undo-tree-id154 . -1) 759 (758 . 759) (757 . 758)) nil (23089 24232 444465 46000) 0 nil]) ((742 . 750) (#("render" 0 6 (fontified t)) . 742) (undo-tree-id155 . -1) (undo-tree-id156 . -1) (undo-tree-id157 . 4) (undo-tree-id158 . -1) (undo-tree-id159 . -1)) nil (23089 24232 444469 446000) 0 nil]) ((#(" " 0 1 (fontified t)) . -763) (undo-tree-id160 . -1) (#("w" 0 1 (fontified t)) . -764) (undo-tree-id161 . -1) (#("l" 0 1 (fontified t)) . -765) (undo-tree-id162 . -1) 766 (763 . 766) (750 . 758) (#("h" 0 1 (fontified t face font-lock-string-face)) . -750) (undo-tree-id163 . -1) (#("o" 0 1 (fontified t face font-lock-string-face)) . -751) (undo-tree-id164 . -1) (#("m" 0 1 (fontified t face font-lock-string-face)) . -752) (undo-tree-id165 . -1) (#("e" 0 1 (fontified t face font-lock-string-face)) . -753) (undo-tree-id166 . -1) (#("'" 0 1 (fontified t face font-lock-string-face)) . -754) (undo-tree-id167 . -1) (#("," 0 1 (fontified t)) . -755) (undo-tree-id168 . -1) (#(" " 0 1 (fontified t)) . -756) (undo-tree-id169 . -1) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . -757) (undo-tree-id170 . -1) (#("}" 0 1 (fontified t face (rainbow-delimiters-depth-4-face))) . 758) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-5-face))) . -758) (undo-tree-id171 . -1) (#("}" 0 1 (fontified t face (rainbow-delimiters-depth-5-face))) . 759) (#("l" 0 1 (fontified t)) . -759) (undo-tree-id172 . -1) (#("o" 0 1 (fontified t)) . -760) (undo-tree-id173 . -1) (#("g" 0 1 (fontified t)) . -761) (undo-tree-id174 . -1) (#("i" 0 1 (fontified t)) . -762) (undo-tree-id175 . -1) (#("n" 0 1 (fontified t)) . -763) (undo-tree-id176 . -1) 764 (759 . 764) (#("u" 0 1 (fontified t)) . -759) (undo-tree-id177 . -1) (#("s" 0 1 (fontified t)) . -760) (undo-tree-id178 . -1) (#("e" 0 1 (fontified t)) . -761) (undo-tree-id179 . -1) (#("r" 0 1 (fontified t)) . -762) (undo-tree-id180 . -1) 763 (759 . 763) (758 . 760) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . -758) (758 . 759) (757 . 759) (#("{" 0 1 (fontified nil)) . -757) (757 . 758) (755 . 757) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 755) (750 . 755) (749 . 751) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . -749) (749 . 750) (737 . 738) (747 . 749) (#("(" 0 1 (fontified nil)) . -747) (737 . 748) (#(" " 0 1 (fontified t)) . -737) (undo-tree-id181 . -1) 738 (734 . 738) (#(" " 0 4 (fontified nil)) . 733) (undo-tree-id182 . -4) (737 . 738) (732 . 737) (t 23089 23821 315401 560000) 731) nil (23089 24232 444493 921000) 0 nil]) ((738 . 763) (#("module.exports = router +" 0 7 (fontified t) 7 23 (fontified t) 23 24 (fontified t)) . 738) (undo-tree-id132 . 1) (undo-tree-id133 . 2) (undo-tree-id134 . 2) (undo-tree-id135 . -22) (undo-tree-id136 . -22) (undo-tree-id137 . -22) (undo-tree-id138 . -24)) nil (23089 23821 276904 784000) 0 nil]) ((752 . 761) (#(":" 0 1 (fontified t)) . -752) (undo-tree-id139 . -1) 753 (738 . 753) (737 . 738) (736 . 737) (t 23089 23750 308528 894000) 735) nil (23089 23821 276911 890000) 0 nil] [nil nil ((#(" console.log(user2); +" 0 17 (fontified t) 17 18 (fontified t face (rainbow-delimiters-depth-5-face)) 18 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-5-face)) 24 26 (fontified t)) . 476) (t 23089 23750 308528 894000)) ((476 . 502)) (23089 23757 61274 790000) 0 nil]) ((476 . 502) (#(" console.log(user2); +" 0 12 (fontified t) 12 13 (fontified t face (rainbow-delimiters-depth-5-face)) 13 18 (fontified t) 18 19 (fontified t face (rainbow-delimiters-depth-5-face)) 19 20 (fontified t) 20 21 (fontified t)) . 476) (undo-tree-id102 . 1) (undo-tree-id103 . -21) (undo-tree-id104 . -21) (undo-tree-id105 . -12) (undo-tree-id106 . -12) (undo-tree-id107 . 2) (undo-tree-id108 . 2) (undo-tree-id109 . -19) (undo-tree-id110 . -19) (undo-tree-id111 . -19) (undo-tree-id112 . -21) (371 . 395) (#(" console.log(user1); +" 0 17 (fontified t) 17 18 (fontified t face (rainbow-delimiters-depth-4-face)) 18 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-4-face)) 24 25 (fontified t) 25 26 (fontified t)) . 371) (undo-tree-id113 . -26) (undo-tree-id114 . -26) (undo-tree-id115 . -26) (undo-tree-id116 . -26) (undo-tree-id117 . -26) (undo-tree-id118 . -26)) nil (23089 23757 61517 359000) 0 nil]) ((497 . 498) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-5-face))) . 497) (undo-tree-id119 . -1) (491 . 497) (490 . 492) (#("(" 0 1 (fontified nil)) . -490) (undo-tree-id120 . -1) (undo-tree-id121 . -1) (487 . 491) (#("k" 0 1 (fontified t)) . -487) (undo-tree-id122 . -1) (#("l" 0 1 (fontified t)) . -488) (undo-tree-id123 . -1) 489 (479 . 489) (477 . 479) 447) nil (23089 23750 286695 527000) 0 nil]) ((395 . 396) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . 395) (undo-tree-id124 . -1) (389 . 395) (388 . 390) (#("(" 0 1 (fontified nil)) . -388) (377 . 389) (370 . 377) 369) nil (23089 23750 286699 465000) 0 nil]) ((#(" +" 0 1 (fontified t)) . -370) (undo-tree-id125 . -1) (#(" " 0 1 (fontified t)) . -371) (undo-tree-id126 . -1) (#(" " 0 1 (fontified t)) . -372) (undo-tree-id127 . -1) (#(" " 0 1 (fontified t)) . -373) (undo-tree-id128 . -1) (#(" " 0 1 (fontified t)) . -374) (undo-tree-id129 . -1) (#(" " 0 1 (fontified t)) . -375) (undo-tree-id130 . -1) (#(" " 0 1 (fontified t)) . -376) (undo-tree-id131 . -1) 377 (370 . 377) (t 23089 23689 524735 534000) 321) nil (23089 23750 286706 898000) 0 nil]) ((537 . 636) (#(" if (user3.referrer) { + let user4 = await User.findById(user3.referrer); + } +" 0 5 (fontified t) 5 6 (fontified t rear-nonsticky t) 6 8 (fontified t face font-lock-keyword-face) 8 9 (fontified t) 9 10 (fontified t face (rainbow-delimiters-depth-6-face)) 10 14 (fontified t) 14 15 (fontified t) 15 24 (fontified t) 24 25 (fontified t face (rainbow-delimiters-depth-6-face)) 25 26 (fontified t) 26 27 (fontified t face (rainbow-delimiters-depth-6-face)) 27 28 (fontified t) 28 36 (fontified t) 36 39 (fontified t face font-lock-keyword-face) 39 40 (fontified t) 40 44 (fontified t face font-lock-variable-name-face) 44 45 (fontified t face font-lock-variable-name-face) 45 67 (fontified t) 67 68 (fontified t face (rainbow-delimiters-depth-7-face)) 68 72 (fontified t) 72 73 (fontified t) 73 82 (fontified t) 82 83 (fontified t face (rainbow-delimiters-depth-7-face)) 83 85 (fontified t) 85 91 (fontified t) 91 92 (fontified t face (rainbow-delimiters-depth-6-face)) 92 93 (fontified t)) . 537) (undo-tree-id88 . -92) (undo-tree-id89 . -92) (undo-tree-id90 . -85) (undo-tree-id91 . -85) (undo-tree-id92 . -93) (undo-tree-id93 . -93) (undo-tree-id94 . -28) (undo-tree-id95 . -28) (undo-tree-id96 . 21) (undo-tree-id97 . 21) (undo-tree-id98 . -72) (undo-tree-id99 . -72) (undo-tree-id100 . -72) (undo-tree-id101 . -93)) nil (23089 23689 500533 648000) 0 nil]) ((609 . 610) (#("2" 0 1 (fontified t)) . 609)) nil (23089 23689 500537 587000) 0 nil]) ((581 . 582) (#("3" 0 1 (fontified t face font-lock-variable-name-face)) . 581)) nil (23089 23689 500539 174000) 0 nil]) ((551 . 552) (#("2" 0 1 (fontified t)) . 551)) nil (23089 23689 500540 229000) 0 nil]) ((nil rear-nonsticky nil 542 . 543) (#(" +" 0 1 (fontified nil)) . -629) (536 . 630) 486 (t 23089 23664 385982 428000)) nil (23089 23689 500541 743000) 0 nil]) ((545 . 551) (371 . 537) (#(" if(user1.referrer){ + let user2 = await User.findById(user1.referrer); + if(user2.referrer){ + let user3 = await User.findById(user2.referrer); + } +" 0 6 (fontified t) 6 8 (fontified t face font-lock-keyword-face) 8 9 (fontified t face (rainbow-delimiters-depth-4-face)) 9 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-4-face)) 24 25 (fontified t face (rainbow-delimiters-depth-4-face)) 25 26 (fontified t) 26 29 (fontified t) 29 30 (fontified t rear-nonsticky t) 30 33 (fontified t face font-lock-keyword-face) 33 34 (fontified t) 34 38 (fontified t face font-lock-variable-name-face) 38 39 (fontified t face font-lock-variable-name-face) 39 53 (fontified t) 53 61 (fontified t) 61 62 (fontified t face (rainbow-delimiters-depth-5-face)) 62 76 (fontified t) 76 77 (fontified t face (rainbow-delimiters-depth-5-face)) 77 78 (fontified t) 78 79 (fontified t) 79 84 (fontified t) 84 85 (fontified t rear-nonsticky t) 85 87 (fontified t face font-lock-keyword-face) 87 88 (fontified t face (rainbow-delimiters-depth-5-face)) 88 92 (fontified t) 92 93 (fontified t) 93 102 (fontified t) 102 103 (fontified t face (rainbow-delimiters-depth-5-face)) 103 104 (fontified t face (rainbow-delimiters-depth-5-face)) 104 105 (fontified t) 105 108 (fontified t) 108 109 (rear-nonsticky t fontified t) 109 112 (fontified t face font-lock-keyword-face) 112 113 (fontified t) 113 117 (fontified t face font-lock-variable-name-face) 117 118 (fontified t face font-lock-variable-name-face) 118 132 (fontified t) 132 140 (fontified t) 140 141 (fontified t face (rainbow-delimiters-depth-6-face)) 141 145 (fontified t) 145 146 (fontified t) 146 155 (fontified t) 155 156 (fontified t face (rainbow-delimiters-depth-6-face)) 156 157 (fontified t) 157 158 (fontified t) 158 164 (fontified t) 164 165 (fontified t face (rainbow-delimiters-depth-5-face)) 165 166 (fontified t)) . 371) (undo-tree-id59 . -165) (undo-tree-id60 . -79) (undo-tree-id61 . -165) (undo-tree-id62 . -26) (undo-tree-id63 . -26) (undo-tree-id64 . -166) (undo-tree-id65 . -166) (undo-tree-id66 . 90) (undo-tree-id67 . -24) (undo-tree-id68 . -105) (undo-tree-id69 . -105) (undo-tree-id70 . -158) (undo-tree-id71 . -158) (undo-tree-id72 . -79) (undo-tree-id73 . -79) (undo-tree-id74 . -78) (undo-tree-id75 . -30) (undo-tree-id76 . -30) (undo-tree-id77 . 21) (undo-tree-id78 . 21) (undo-tree-id79 . -145) (undo-tree-id80 . -145) (undo-tree-id81 . -145) (undo-tree-id82 . -166)) nil (23089 23664 355556 477000) 0 nil]) ((516 . 517) (#("1" 0 1 (fontified t)) . 516)) nil (23089 23664 355560 422000) 0 nil]) ((488 . 489) (#("2" 0 1 (fontified t face font-lock-variable-name-face)) . 488)) nil (23089 23664 355561 907000) 0 nil]) ((463 . 464) (#("1" 0 1 (fontified t)) . 463)) nil (23089 23664 355562 954000) 0 nil]) ((nil rear-nonsticky nil 455 . 456) (#(" +" 0 1 (fontified nil)) . -536) (449 . 537) 421) nil (23089 23664 355564 443000) 0 nil]) ((433 . 447) (#("req.params.id" 0 13 (fontified t)) . 433) (undo-tree-id83 . -1) 434) nil (23089 23664 355566 544000) 0 nil]) ((#("1" 0 1 (fontified t face font-lock-variable-name-face)) . 409) (410 . 411)) nil (23089 23664 355567 629000) 0 nil]) ((nil rear-nonsticky nil 400 . 401) (#(" +" 0 1 (fontified nil)) . -448) (396 . 449) 377) nil (23089 23664 355569 141000) 0 nil]) ((#(" let user2 +" 0 3 (fontified t) 3 6 (fontified t face font-lock-keyword-face) 6 7 (fontified t) 7 12 (fontified t face font-lock-variable-name-face) 12 13 (fontified t)) . 397) (undo-tree-id84 . 1) (undo-tree-id85 . -11) 408) nil (23089 23664 355571 513000) 0 nil]) ((#(" " 0 1 (fontified t)) . -409) (undo-tree-id86 . -1) 410 (408 . 410) (#("1" 0 1 (fontified t face font-lock-variable-name-face)) . -408) (undo-tree-id87 . -1) 409 (400 . 409) (397 . 400) (397 . 398) 402) nil (23089 23664 355575 185000) 0 nil]) ((396 . 403) (395 . 397) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . -395) (395 . 396) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . 395) (380 . 395) (379 . 381) (#("(" 0 1 (fontified nil face font-lock-keyword-face)) . -379) (377 . 380) (370 . 377) 331) nil (23089 23664 355578 765000) 0 nil]) ((331 . 332) (t 23089 23386 915988 48000)) nil (23089 23664 355580 499000) 0 nil]) ((370 . 407) (#(" } + catch(e){next(e)} +}) +" 0 4 (fontified t) 4 5 (fontified t face (rainbow-delimiters-depth-3-face)) 5 6 (fontified t) 6 10 (fontified t) 10 15 (fontified t face font-lock-keyword-face) 15 16 (fontified t face (rainbow-delimiters-depth-3-face)) 16 17 (fontified t) 17 18 (fontified t face (rainbow-delimiters-depth-3-face)) 18 19 (fontified t face (rainbow-delimiters-depth-3-face)) 19 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-4-face)) 24 25 (fontified t) 25 26 (fontified t face (rainbow-delimiters-depth-4-face)) 26 27 (fontified t face (rainbow-delimiters-depth-3-face)) 27 28 (fontified t) 28 29 (fontified nil face (rainbow-delimiters-depth-2-face)) 29 30 (fontified nil face (rainbow-delimiters-depth-1-face)) 30 31 (fontified nil)) . 370) (undo-tree-id0 . -30) (undo-tree-id1 . -30) (undo-tree-id2 . 5) (undo-tree-id3 . -6) (undo-tree-id4 . -6) (undo-tree-id5 . -28) (undo-tree-id6 . -28) (undo-tree-id7 . 6) (undo-tree-id8 . 6) (undo-tree-id9 . -25) (undo-tree-id10 . -25) (undo-tree-id11 . -25) (undo-tree-id12 . -31) (270 . 319) (#("router.get('/', (req, res) => { + res.redirect('/'); +}) + +router.get('/:id', async (req, res) => { + try{ +" 0 10 (fontified t) 10 11 (fontified t face (rainbow-delimiters-depth-1-face)) 11 14 (fontified t face font-lock-string-face) 14 16 (fontified t) 16 17 (fontified t face (rainbow-delimiters-depth-2-face)) 17 25 (fontified t) 25 26 (fontified t face (rainbow-delimiters-depth-2-face)) 26 30 (fontified t) 30 31 (fontified t face (rainbow-delimiters-depth-2-face)) 31 32 (fontified t) 32 48 (fontified t) 48 49 (fontified t face (rainbow-delimiters-depth-3-face)) 49 52 (fontified t face font-lock-string-face) 52 53 (fontified t face (rainbow-delimiters-depth-3-face)) 53 54 (fontified t) 54 55 (fontified t) 55 56 (fontified t face (rainbow-delimiters-depth-2-face)) 56 57 (fontified t face (rainbow-delimiters-depth-1-face)) 57 58 (rear-nonsticky t fontified t) 58 59 (fontified t) 59 69 (fontified t) 69 70 (fontified t face (rainbow-delimiters-depth-1-face)) 70 76 (fontified t face font-lock-string-face) 76 84 (fontified t) 84 85 (fontified t face (rainbow-delimiters-depth-2-face)) 85 93 (fontified t) 93 94 (fontified t face (rainbow-delimiters-depth-2-face)) 94 98 (fontified t) 98 99 (fontified t face (rainbow-delimiters-depth-2-face)) 99 100 (fontified t) 100 104 (fontified t) 104 107 (fontified t face font-lock-keyword-face) 107 108 (fontified t face (rainbow-delimiters-depth-3-face)) 108 109 (fontified t)) . 270) (undo-tree-id13 . -58) (undo-tree-id14 . -32) (undo-tree-id15 . -32) (undo-tree-id16 . -55) (undo-tree-id17 . -55) (undo-tree-id18 . -55) (undo-tree-id19 . -58) (undo-tree-id20 . -58) (undo-tree-id21 . -100) (undo-tree-id22 . -100) (undo-tree-id23 . -59) (undo-tree-id24 . -59) (undo-tree-id25 . -109) (undo-tree-id26 . -109) (undo-tree-id27 . -32) (undo-tree-id28 . -109) (212 . 269) (93 . 211) (#("const User = require('./../models/User'); +const mongoose = require('mongoose'); +const passport = require('passport'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 10 (fontified t face font-lock-variable-name-face) 10 20 (fontified t) 20 21 (fontified t face (rainbow-delimiters-depth-1-face)) 21 39 (fontified t face font-lock-string-face) 39 40 (fontified t face (rainbow-delimiters-depth-1-face)) 40 42 (fontified t) 42 47 (fontified t face font-lock-keyword-face) 47 48 (fontified t) 48 56 (fontified t face font-lock-variable-name-face) 56 66 (fontified t) 66 67 (fontified t face (rainbow-delimiters-depth-1-face)) 67 77 (fontified t face font-lock-string-face) 77 78 (fontified t face (rainbow-delimiters-depth-1-face)) 78 80 (fontified t) 80 85 (fontified t face font-lock-keyword-face) 85 86 (fontified t) 86 94 (fontified t face font-lock-variable-name-face) 94 104 (fontified t) 104 105 (fontified t face (rainbow-delimiters-depth-1-face)) 105 115 (fontified t face font-lock-string-face) 115 116 (fontified t face (rainbow-delimiters-depth-1-face)) 116 117 (fontified t) 117 118 (fontified t)) . 93) (undo-tree-id29 . -42) (undo-tree-id30 . -42) (undo-tree-id31 . -80) (undo-tree-id32 . -80) (undo-tree-id33 . -118) (undo-tree-id34 . -118) (undo-tree-id35 . -118) (1 . 37) (#("const express = require('express'); +" 0 5 (fontified t face font-lock-keyword-face) 5 6 (fontified t) 6 13 (fontified t face font-lock-variable-name-face) 13 23 (fontified t) 23 24 (fontified t face (rainbow-delimiters-depth-1-face)) 24 33 (fontified t face font-lock-string-face) 33 34 (fontified t face (rainbow-delimiters-depth-1-face)) 34 35 (fontified t) 35 36 (fontified t)) . 1) (undo-tree-id36 . -36) (undo-tree-id37 . -36) (undo-tree-id38 . -36) (403 . 404)) nil (23089 23386 890463 380000) 0 nil]) ((#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . 399) (397 . 399) (396 . 398) (#("(" 0 1 (fontified nil)) . -396) (392 . 397) (#("c" 0 1 (fontified t)) . -392) (undo-tree-id39 . -1) (#("o" 0 1 (fontified t)) . -393) (undo-tree-id40 . -1) (#("n" 0 1 (fontified t)) . -394) (undo-tree-id41 . -1) (#("s" 0 1 (fontified t)) . -395) (undo-tree-id42 . -1) 396 (392 . 396) (391 . 393) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . -391) (391 . 392) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . 391) (389 . 391) (388 . 390) (#("(" 0 1 (fontified nil face font-lock-keyword-face)) . -388) (383 . 389) (378 . 383) 377) nil (23089 23386 890477 349000) 0 nil]) ((#(" " 0 1 (fontified nil)) . -377) (377 . 378) (#(" " 0 1 (fontified nil)) . 377) (undo-tree-id43 . -1) (373 . 377) (374 . 375) (372 . 374) 329) nil (23089 23386 890484 484000) 0 nil]) ((#("}" 0 1 (fontified t face (rainbow-delimiters-depth-3-face))) . 321) (320 . 322) (#("{" 0 1 (fontified nil face font-lock-keyword-face)) . -320) (317 . 321) (313 . 317) (313 . 314) 362) nil (23089 23386 890488 945000) 0 nil]) ((362 . 363) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . 362) (361 . 362) (348 . 361) (347 . 349) (#("(" 0 1 (fontified nil)) . -347) (347 . 348) (339 . 347) (#("findBy" 0 6 (fontified t)) . -339) (undo-tree-id44 . -6) 345 (343 . 345) (#("(" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . -343) (undo-tree-id45 . -1) (#(")" 0 1 (fontified t face (rainbow-delimiters-depth-3-face))) . 344) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-4-face))) . -344) (undo-tree-id46 . -1) (#("}" 0 1 (fontified t face (rainbow-delimiters-depth-4-face))) . 345) (#("i" 0 1 (fontified t)) . -345) (undo-tree-id47 . -1) 346 (345 . 346)) nil (23089 23386 890499 977000) 0 nil]) ((328 . 334)) nil (23089 23386 890503 334000) 0 nil]) ((338 . 340) (#("{" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . -338) (338 . 339) (337 . 339) (#("(" 0 1 (fontified nil)) . -337) (328 . 338) (#("u" 0 1 (fontified t)) . -328) (undo-tree-id48 . -1) (#("s" 0 1 (fontified t)) . -329) (undo-tree-id49 . -1) (#("e" 0 1 (fontified t)) . -330) (undo-tree-id50 . -1) (#("r" 0 1 (fontified t)) . -331) (undo-tree-id51 . -1) (#("." 0 1 (fontified t)) . -332) (undo-tree-id52 . -1) 333 (317 . 333)) nil (23089 23386 890510 186000) 0 nil]) ((291 . 297)) nil (23089 23386 890561 900000) 0 nil]) ((307 . 311)) nil (23089 23386 890562 864000) 0 nil]) ((266 . 267) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . 266) (265 . 266) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 265) (263 . 265) (262 . 264) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-3-face))) . -262) (262 . 263) (261 . 263) (#("(" 0 1 (fontified nil)) . -261) (249 . 262) (245 . 249)) nil (23089 23386 890565 678000) 0 nil]) ((#(" " 0 1 (fontified t)) . -245) (undo-tree-id53 . -1) 246 (245 . 246)) nil (23089 23386 890569 114000) 0 nil]) ((#("'" 0 1 (fontified nil face font-lock-string-face)) . -245) (undo-tree-id54 . -1) (#("'" 0 1 (fontified t face font-lock-string-face)) . 246) (245 . 247) (#("'" 0 1 (fontified nil)) . -245) (245 . 246)) nil (23089 23386 890572 64000) 0 nil]) ((249 . 250) 264) nil (23089 23386 890573 484000) 0 nil]) ((262 . 265)) nil (23089 23386 890574 259000) 0 nil]) ((nil rear-nonsticky nil 248 . 249) (#(" +" 0 1 (fontified nil)) . -284) (248 . 285) 246) nil (23089 23386 890575 782000) 0 nil]) ((#(" " 0 4 (fontified t)) . -245) (undo-tree-id55 . -4) 249 (245 . 249) (245 . 246)) nil (23089 23386 890577 931000) 0 nil]) ((244 . 245) (243 . 245) (#("{" 0 1 (fontified nil)) . -243) (241 . 244) (#(" " 0 1 (fontified t)) . -241) (undo-tree-id56 . -1) 242 (239 . 242) (#(" " 0 1 (fontified t)) . -239) (undo-tree-id57 . -1) 240 (239 . 240) (#(")" 0 1 (fontified nil face (rainbow-delimiters-depth-2-face))) . 239) (230 . 239) (229 . 231) (#("(" 0 1 (fontified nil)) . -229) (227 . 230) (#("'" 0 1 (fontified nil face font-lock-string-face)) . 227) (225 . 227) (224 . 226) (#("'" 0 1 (fontified nil face (rainbow-delimiters-depth-1-face))) . -224) (224 . 225) (223 . 225) (#("(" 0 1 (fontified nil)) . -223) (213 . 224) (211 . 213) (210 . 211) 173) nil (23089 23386 890584 484000) 0 nil]) ((#(" +" 0 1 (fontified t rear-nonsticky t)) . 1) (undo-tree-id58 . -1)) nil (23089 23386 890587 759000) 0 nil]) ((nil rear-nonsticky nil 1 . 2) (#(" +" 0 1 (fontified nil)) . -211) (1 . 212) (t 23089 23178 943410 855000)) nil (23089 23386 890589 728000) 0 nil]) nil nil (23089 23386 890590 459000) 0 nil] #1# 4906 49 nil] \ No newline at end of file diff --git a/routers/home.js b/routers/home.js new file mode 100644 index 0000000..a16e9f1 --- /dev/null +++ b/routers/home.js @@ -0,0 +1,167 @@ +const express = require("express"); +const app = express(); +const router = express.Router(); +const User = require("./../models/User"); +const mongoose = require("mongoose"); +const passport = require("passport"); + +// 1 +const findTree = async function(user, distance) { + let usrArr = await User.find({ + referrer: user._id + }); + let recursiveArray = []; + let temp; + for (let i = 0; i < usrArr.length; i++) { + temp = await findTree(usrArr[i], distance + 1); + recursiveArray = recursiveArray.concat(temp); + } + recursiveArray.unshift([ + user.username, + distance, + user.date.toString().substring(4, 15) + ]); + return recursiveArray; +}; + +const calcPoints = distance => { + switch (distance) { + case 1: + return 40; + break; + case 2: + return 20; + break; + case 3: + return 10; + break; + case 4: + return 5; + break; + case 5: + return 2; + break; + default: + return 1; + } +}; + +router.get("/", async (req, res) => { + let user; + let referrer; + let userArray; + let pointsArray; + let sum = 0; + let levels; + try { + user = await User.findById(req.user.id); + userArray = await findTree(user, 0); + userArray.shift(); + // console.log( + // "---------------------------------------------------------------------", + // userArray + // ); + + userArray.forEach( + (x, i) => (userArray[i][3] = " ".repeat(userArray[i][1])) + ); + + levels = []; + levels[0] = [0, 0, 1]; + userArray.forEach(x => { + levels[x[1]] = levels[x[1]] || [0, 0, 0]; + levels[x[1]][2] += 1; + // console.log(levels); + }); + levels.forEach((x, i) => { + levels[i][0] = (i + 1) * 50; + levels[i][1] = (levels.length - i) * 25; + levels[i][3] = (levels.length + 1) * 25 - 5; + }); + userArray.forEach((x, i) => (userArray[i][1] = calcPoints(x[1]))); + + userArray.forEach(x => (sum += x[1])); + sum -= user.pointsSpent; + + if (user.referrer) { + referrer = await User.findById(user.referrer); + } + } finally { + if (req.user) { + res.render("home", { + referrer, + user, + userArray, + sum, + levels + }); + } else { + res.redirect("/login"); + } + } +}); + +// 2 +router.get("/login", (req, res) => { + res.render("login"); +}); + +router.get("/register", (req, res) => { + res.render("register"); +}); + +router.get("/register/:id", (req, res) => { + res.render("register"); +}); + +// 3 +router.post( + "/login", + passport.authenticate("local", { + successRedirect: "/", + failureRedirect: "/login", + failureFlash: true + }) +); + +router.post("/register/:id", async (req, res, next) => { + let { username, password } = req.body; + let currentUser = new User({ + username, + password + }); + currentUser.referrer = req.params.id; + currentUser.save((err, user) => { + req.login(user, function(err) { + if (err) { + return next(err); + } + return res.redirect("/"); + }); + }); +}); + +// 4 +router.post("/register", (req, res, next) => { + const { username, password } = req.body; + const user = new User({ + username, + password + }); + user.save((err, user) => { + req.login(user, function(err) { + if (err) { + return next(err); + } + return res.redirect("/"); + }); + }); +}); + +// 5 +router.get("/logout", function(req, res) { + req.logout(); + res.redirect("/"); +}); + +module.exports = router; diff --git a/routers/ponzvert.js b/routers/ponzvert.js new file mode 100644 index 0000000..61bb69f --- /dev/null +++ b/routers/ponzvert.js @@ -0,0 +1,16 @@ +const express = require('express'); +const app = express(); +const router = express.Router(); +const User = require('./../models/User'); +const mongoose = require('mongoose'); +const passport = require('passport'); + +router.get('/', (req, res) => { + res.redirect('/'); +}); + +router.get('/:id', (req, res) => { + res.redirect(`/register/${req.params.id}`); +}); + +module.exports = router; diff --git a/routers/ponzvert.js~ b/routers/ponzvert.js~ new file mode 100644 index 0000000..e69de29 diff --git a/routers/shop.js b/routers/shop.js new file mode 100644 index 0000000..79a9cf8 --- /dev/null +++ b/routers/shop.js @@ -0,0 +1,117 @@ +const express = require('express'); +const app = express(); +const router = express.Router(); +const User = require('./../models/User'); +const Cereal = require('./../models/Cereal'); +const mongoose = require('mongoose'); +const passport = require('passport'); + +const findTree = async function(user, distance) { + let usrArr = await User.find({ + referrer: user._id, + }); + console.log('user', user, 'userid', user._id); + console.log(usrArr); + if (usrArr === []) { + return [user.username, distance]; + } else { + let recursiveArray = []; + let temp; + for (let i = 0; i < usrArr.length; i++) { + temp = await findTree(usrArr[i], distance + 1); + recursiveArray = recursiveArray.concat(temp); + } + // console.log("========================RECURSIVEARRAY", recursiveArray); + // let recursiveArray = await usrArr.map(async function(x) { + // let y = await findTree(x, distance + 1); + // return y; + // }); + recursiveArray.unshift([ + user.username, + distance, + user.date.toString().substring(4, 15), + ]); + return recursiveArray; + } +}; + +const calcPoints = distance => { + switch (distance) { + case 1: + return 40; + break; + case 2: + return 20; + break; + case 3: + return 10; + break; + case 4: + return 5; + break; + case 5: + return 2; + break; + default: + return 1; + } +}; + +router.get('/', async (req, res, next) => { + try { + result = await Cereal.find(); + } catch (e) { + next(e); + } + console.log(req.user); + let user = req.user; + res.render('shop', { + result, + user, + }); +}); + +router.get('/:id/buy', async (req, res, next) => { + let user = req.user; + let userTree; + let points = 0; + let cereal; + try { + cereal = await Cereal.findById(req.params.id); + userTree = await findTree(req.user, 0); + } catch (e) { + next(e); + } + userTree.shift(); + userTree.forEach(x => (points += calcPoints(x[1]))); + console.log(points); + points -= user.pointsSpent; + console.log(points); + if (points >= cereal.price) { + user.pointsSpent += cereal.price; + try { + await User.findByIdAndUpdate(user._id, user); + } catch (e) { + next(e); + } + res.render('buy', { + cereal, + }); + } else { + res.render('poor'); + } +}); + +router.get('/:id', async (req, res, next) => { + let cereal; + try { + cereal = await Cereal.findById(req.params.id); + } catch (e) { + next(e); + } + res.render('cereal', { + cereal, + }); +}); + +module.exports = router; diff --git a/routers/shop.js~ b/routers/shop.js~ new file mode 100644 index 0000000..e69de29 diff --git a/views/.home.handlebars.~undo-tree~ b/views/.home.handlebars.~undo-tree~ new file mode 100644 index 0000000..c43ab65 --- /dev/null +++ b/views/.home.handlebars.~undo-tree~ @@ -0,0 +1,113 @@ +"eb934b87b5a69edf31dc9bfbd8d65690a4a4ad81" +[cl-struct-undo-tree [nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil (#1=[nil nil ((982 . 992) (#(" " 0 1 (fontified nil)) . 981) (undo-tree-id155 . -1) (982 . 983)) nil (23091 4026 908591 586000) 0 nil]) ((937 . 949) (#(" " 0 1 (fontified nil)) . 936) (undo-tree-id156 . -1) (937 . 938)) nil (23091 4026 908611 392000) 0 nil]) ((#("w" 0 1 (fontified t)) . -928) (undo-tree-id157 . -1) 929 (928 . 929) (918 . 928) (#(" " 0 1 (fontified nil)) . 917) (undo-tree-id158 . -1) (918 . 919)) nil (23091 4026 908623 123000) 0 nil]) ((896 . 908) (#(" " 0 1 (fontified nil)) . 895) (undo-tree-id159 . -1) (896 . 897)) nil (23091 4026 908630 669000) 0 nil]) ((#("w" 0 1 (fontified t)) . -757) (undo-tree-id160 . -1) (#("w" 0 1 (fontified t)) . -758) (undo-tree-id161 . -1) 759 (757 . 759) (745 . 757) (#(" " 0 1 (fontified nil)) . 744) (undo-tree-id162 . -1) (745 . 746)) nil (23091 4026 908642 377000) 0 nil]) ((700 . 712) (#(" " 0 1 (fontified nil)) . 699) (undo-tree-id163 . -1) (#(" " 0 2 (fontified nil)) . -682) (702 . 703)) nil (23091 4026 908650 190000) 0 nil]) ((1 . 1595) (#("
Share this link with your friends to ponvert them!
+Share this link with your friends to ponvert them!
+Share this link with your friends to ponvert them!
+{{ error }}+
Share this link with your friends to ponvert them!
++ {{product.name}} +
+Name:
{{product.name}}
Price: ${{product.price}}
+ +