This repository has been archived by the owner on Apr 22, 2019. It is now read-only.
forked from Dirrk/2015-hr-resolutions
-
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.
- Loading branch information
dirrk
committed
Oct 15, 2015
0 parents
commit 4f062da
Showing
13 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = space | ||
indent_size = 4 | ||
quote_type = single | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[*.js] | ||
space_after_control_statements = true | ||
space_after_anonymous_functions = true | ||
spaces_around_operators = true | ||
spaces_in_brackets = hybrid | ||
|
||
[package.json] | ||
indent_size = 2 |
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,26 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage* | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Deployed apps should consider commenting this line out: | ||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git | ||
node_modules | ||
.idea |
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,50 @@ | ||
{ | ||
"disallowEmptyBlocks": true, | ||
"disallowSpacesInsideArrayBrackets": true, | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowQuotedKeysInObjects": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"disallowSpaceAfterPrefixUnaryOperators": true, | ||
"disallowSpaceBeforePostfixUnaryOperators": true, | ||
"disallowSpaceBeforeBinaryOperators": [ | ||
"," | ||
], | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowTrailingComma": true, | ||
"disallowYodaConditions": true, | ||
"disallowKeywords": [ "with" ], | ||
"disallowNewlineBeforeBlockStatements": true, | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireMultipleVarDecl": "onevar", | ||
"requireBlocksOnNewline": 1, | ||
"requireCommaBeforeLineBreak": true, | ||
"requireSpaceBeforeBinaryOperators": true, | ||
"requireSpaceAfterBinaryOperators": true, | ||
"requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", | ||
"requireLineFeedAtFileEnd": true, | ||
"requireCapitalizedConstructors": true, | ||
"requireDotNotation": true, | ||
"requireCurlyBraces": [ | ||
"do" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"case", | ||
"return", | ||
"try", | ||
"catch", | ||
"typeof" | ||
], | ||
"safeContextKeyword": ["_this", "self"], | ||
"validateLineBreaks": "LF", | ||
"validateQuoteMarks": "'", | ||
"excludeFiles": ["node_modules/**"] | ||
} |
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,22 @@ | ||
{ | ||
"eqnull": true, | ||
"nonew": true, | ||
"curly": true, | ||
"unused": "vars", | ||
"noarg": true, | ||
"indent": 4, | ||
"forin": true, | ||
"noempty": true, | ||
"quotmark": "single", | ||
"node": true, | ||
"eqeqeq": true, | ||
"strict": true, | ||
"undef": true, | ||
"bitwise": true, | ||
"newcap": true, | ||
"immed": true, | ||
"nonbsp": true, | ||
"freeze": true, | ||
"globalstrict": 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,3 @@ | ||
Hampton Roads Resolutions | ||
================= | ||
|
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,23 @@ | ||
'use strict'; | ||
|
||
// Setup hapi | ||
var setup = require('./lib/setup'); | ||
|
||
setup(function (err) { | ||
if (err) { | ||
exit(err); | ||
} else { | ||
console.log('Setup server completed'); | ||
} | ||
process.on('uncaughtException', exit); | ||
process.on('uncaughtRejection', exit); | ||
process.on('error', exit); | ||
}); | ||
|
||
|
||
function exit(err) { | ||
if (err) { | ||
console.error(err); | ||
} | ||
process.exit(err ? 1 : 0); | ||
} |
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,8 @@ | ||
'use strict'; | ||
|
||
exports.createReport = function (request, reply) { | ||
reply({ | ||
status: 200, | ||
tracking: '000000-00000-000000000' | ||
}); | ||
}; |
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,9 @@ | ||
'use strict'; | ||
|
||
var constants = { | ||
server: { | ||
port: 3000 | ||
} | ||
}; | ||
|
||
module.exports = Object.freeze(constants); |
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,9 @@ | ||
'use strict'; | ||
|
||
var report = require('./api/report'); | ||
|
||
module.exports = [ | ||
{ method: 'GET', path: '/', handler: { file: function () { return 'public/index.html'; }}}, | ||
{ method: 'GET', path: '/javascript/{file?}', handler: { directory: { path: 'public/javascript/'}}}, | ||
{ method: 'POST', path: '/api/report', handler: report.createReport } | ||
]; |
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,26 @@ | ||
'use strict'; | ||
|
||
var Hapi = require('hapi'), | ||
config = require('./config'); | ||
|
||
module.exports = function (next) { | ||
var server = new Hapi.Server(); | ||
|
||
server.connection(config.server); | ||
server.start(function (err) { | ||
if (err) { | ||
return next(err); | ||
} | ||
console.log('Server listening on ', server.info.uri); | ||
setupRoutes(server, next); | ||
}); | ||
}; | ||
|
||
function setupRoutes(server, next) { | ||
var routes = require('./routes'); | ||
|
||
routes.forEach(function (route) { | ||
server.route(route); | ||
}); | ||
next(); | ||
} |
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,14 @@ | ||
{ | ||
"name": "2015-hr-resolution", | ||
"version": "1.0.0", | ||
"description": "2015 DE Hampton Roads Resolutions app", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "npm test" | ||
}, | ||
"dependencies": { | ||
"hapi": "8.x.x" | ||
}, | ||
"author": "Homes.com", | ||
"license": "MIT" | ||
} |
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,8 @@ | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="/javascript/test.js"></script> | ||
</head> | ||
<body> | ||
<h2> Hello World </h2> | ||
</body> | ||
</html> |
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,2 @@ | ||
var a = 'Hello world'; | ||
console.log(a); |