-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new yo mongoose with highscores hooked up to set. renamed zest.
- Loading branch information
0 parents
commit 61b85ce
Showing
8,693 changed files
with
1,242,396 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"directory": "public/bower_components", | ||
"interactive" : false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"node": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 4, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
module.exports = function(grunt) { | ||
require('load-grunt-tasks')(grunt); | ||
grunt.initConfig({ | ||
// Configure a mochaTest task | ||
mochaTest: { | ||
test: { | ||
options: { | ||
reporter: 'spec' | ||
}, | ||
src: ['test/**/*.js'] | ||
} | ||
}, | ||
watch: { | ||
options: { | ||
livereload: true, | ||
}, | ||
express: { | ||
files: [ '*.js','routes/*.js', 'models/*.js', 'config/*.js' ], | ||
tasks: [ 'express:dev' ], | ||
options: { | ||
spawn: false // Without this option specified express won't be reloaded | ||
} | ||
} | ||
}, | ||
express: { | ||
options: { | ||
port : 3000, | ||
node_env: 'development' | ||
}, | ||
dev: { | ||
options: { | ||
script: 'app.js', | ||
node_env: 'development' | ||
} | ||
}, | ||
prod: { | ||
options: { | ||
script: 'app.js', | ||
node_env: 'production' | ||
} | ||
} | ||
}, | ||
open: { | ||
server: { | ||
url: 'http://localhost:<%= express.options.port %>' | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('test', 'mochaTest'); | ||
|
||
grunt.registerTask('server', function(arg) { | ||
if(arg && arg == 'prod') | ||
{ | ||
grunt.task.run([ | ||
'express:prod', | ||
'open', | ||
'watch' | ||
]); | ||
} | ||
else | ||
{ | ||
grunt.task.run([ | ||
'express:dev', | ||
'open', | ||
'watch' | ||
]); | ||
} | ||
}); | ||
grunt.registerTask('default', [ 'server' ]); | ||
grunt.registerTask('dist', [ 'server:prod' ]); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Set_server | ||
|
||
Doc, are you telling me that you built a time machine out of a delorean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
'use strict'; | ||
|
||
// Module dependencies. | ||
var express = require('express'), | ||
path = require('path'), | ||
fs = require('fs'), | ||
methodOverride = require('method-override'), | ||
morgan = require('morgan'), | ||
bodyParser = require('body-parser'), | ||
errorhandler = require('errorhandler'); | ||
|
||
var app = module.exports = exports.app = express(); | ||
|
||
app.locals.siteName = "Set_server"; | ||
|
||
// Connect to database | ||
var db = require('./config/db'); | ||
app.use(express.static(__dirname + '/public')); | ||
|
||
|
||
// Bootstrap models | ||
var modelsPath = path.join(__dirname, 'models'); | ||
fs.readdirSync(modelsPath).forEach(function (file) { | ||
require(modelsPath + '/' + file); | ||
}); | ||
|
||
var env = process.env.NODE_ENV || 'development'; | ||
|
||
if ('development' == env) { | ||
app.use(morgan('dev')); | ||
app.use(errorhandler({ | ||
dumpExceptions: true, | ||
showStack: true | ||
})); | ||
app.set('view options', { | ||
pretty: true | ||
}); | ||
} | ||
|
||
if ('test' == env) { | ||
app.use(morgan('test')); | ||
app.set('view options', { | ||
pretty: true | ||
}); | ||
app.use(errorhandler({ | ||
dumpExceptions: true, | ||
showStack: true | ||
})); | ||
} | ||
|
||
if ('production' == env) { | ||
app.use(morgan()); | ||
app.use(errorhandler({ | ||
dumpExceptions: false, | ||
showStack: false | ||
})); | ||
} | ||
|
||
app.engine('html', require('ejs').renderFile); | ||
app.set('view engine', 'html'); | ||
app.use(methodOverride()); | ||
app.use(bodyParser()); | ||
|
||
// Bootstrap routes/api | ||
var routesPath = path.join(__dirname, 'routes'); | ||
fs.readdirSync(routesPath).forEach(function(file) { | ||
require(routesPath + '/' + file)(app); | ||
}); | ||
|
||
// Start server | ||
var port = process.env.PORT || 3000; | ||
app.listen(port, function () { | ||
console.log('Express server listening on port %d in %s mode', port, app.get('env')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "set-server", | ||
"version": "0.0.1", | ||
"description": "Sample Description", | ||
"private": true, | ||
"dependencies": { | ||
"jquery": "latest" | ||
}, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
var mongoose = require('mongoose'); | ||
|
||
var config = { | ||
"db": "highScores", | ||
"host": "localhost", | ||
"user": "", | ||
"pw": "", | ||
"port": 27017 | ||
}; | ||
|
||
var port = (config.port.length > 0) ? ":" + config.port : ''; | ||
var login = (config.user.length > 0) ? config.user + ":" + config.pw + "@" : ''; | ||
var uristring = process.env.MONGOLAB_URI || process.env.MONGOHQ_URL || "mongodb://" + login + config.host + port + "/" + config.db; | ||
|
||
var mongoOptions = { db: { safe: true } }; | ||
|
||
// Connect to Database | ||
mongoose.connect(uristring, mongoOptions, function (err, res) { | ||
if(err){ | ||
console.log('ERROR connecting to: ' + uristring + '. ' + err); | ||
}else{ | ||
console.log('Successfully connected to: ' + uristring); | ||
} | ||
}); | ||
|
||
|
||
exports.mongoose = mongoose; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
var mongoose = require('mongoose'), | ||
Schema = mongoose.Schema, | ||
ObjectId = Schema.ObjectId; | ||
|
||
var fields = { | ||
username: { type: String }, | ||
highscore: { type: Number }, | ||
gif: { type: String }, | ||
created: { type: Date , default: Date.now } | ||
}; | ||
|
||
var scoreSchema = new Schema(fields); | ||
|
||
module.exports = mongoose.model('Score', scoreSchema); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.