forked from zajacje/mementogo
-
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
0 parents
commit 2203eaa
Showing
12 changed files
with
167 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,19 @@ | ||
node_modules | ||
npm-debug.log | ||
package-lock.json | ||
yarn.lock | ||
|
||
test | ||
temp* | ||
|
||
.env | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
### IDE Settings (EditorConfig/Sublime) | ||
.editorconfig | ||
|
||
### IDE Settings (VSCode) | ||
.vscode |
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,19 @@ | ||
Copyright (c) 2019 Major League Hacking, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE |
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,15 @@ | ||
# Introduction | ||
|
||
This is a hackathon boilerplate for new Nodejs applications created by [Major League Hacking][mlh-github]. It is for hackers looking to get started quickly on a new hackathon project using the Nodejs environment. | ||
|
||
# Code of Conduct | ||
|
||
We enforce a Code of Conduct for all maintainers and contributors of this Guide. Read more in [CONDUCT.md][mlh-conduct]. | ||
|
||
# License | ||
|
||
The Hackathon Starter Kit is open source software [licensed as MIT][mlh-license]. | ||
|
||
[mlh-github]: https://github.com/jekyll/jekyll/blob/master/CONDUCT.markdown | ||
[mlh-conduct]: https://github.com/MLH/mlh-hackathon-nodejs-starter/blob/master/docs/CONDUCT.md | ||
[mlh-license]: https://github.com/MLH/mlh-hackathon-nodejs-starter/blob/master/LICENSE.md |
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,17 @@ | ||
const express = require("express"); | ||
|
||
const router = express.Router(); | ||
|
||
router.get("/logout", function(req, res) { | ||
// TODO | ||
}); | ||
|
||
router.get("/login/github", function(req, res) { | ||
// TODO | ||
}); | ||
|
||
router.get("/callback/github", function(req, res) { | ||
// TODO | ||
}); | ||
|
||
module.exports = router; |
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 @@ | ||
const express = require("express"); | ||
|
||
const router = express.Router(); | ||
|
||
router.get("/requesting", function(req, res) { | ||
// TODO | ||
}); | ||
|
||
module.exports = router; |
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 @@ | ||
const express = require("express"); | ||
|
||
const router = express.Router(); | ||
|
||
router.get("/", function(req, res) { | ||
// TODO | ||
}); | ||
|
||
module.exports = router; |
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,5 @@ | ||
const auth = require("./auth"); | ||
const guides = require("./guides"); | ||
const home = require("./home"); | ||
|
||
module.exports = { auth, guides, home }; |
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,18 @@ | ||
const express = require("express"); | ||
const bodyParser = require("body-parser"); | ||
const compression = require("compression"); | ||
|
||
const config = require("../config"); | ||
const { registerRoutes, registerErrorHandlers } = require("./routes"); | ||
|
||
const app = express(); | ||
|
||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({ extended: true })); | ||
|
||
registerRoutes(app); | ||
registerErrorHandlers(app); | ||
|
||
app.listen(config.port, () => { | ||
console.log(`🚀 Server started on port ${config.port}.`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const controllers = require("./controllers"); | ||
const config = require("../config"); | ||
|
||
module.exports.registerRoutes = app => { | ||
app.use("/", controllers.home); | ||
app.use("/auth", controllers.auth); | ||
app.use("/guides", controllers.guide); | ||
}; | ||
|
||
module.exports.registerErrorHandlers = app => { | ||
app.use(function(err, req, res, next) { | ||
res.status(err.status || 500); | ||
res.render("error", { | ||
message: err.message, | ||
error: config.env === "development" ? err : {} | ||
}); | ||
}); | ||
}; |
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 @@ | ||
module.exports = { | ||
port: process.env.PORT || 5000, | ||
env: process.env.NODE_ENV || "development" | ||
}; |
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,18 @@ | ||
# Code of Conduct | ||
|
||
All contributors and maintainers of this guide, in the interest of fostering an open and welcoming community, are required to adhere to the [Major League Hacking Code of Conduct][mlh-coc]. | ||
|
||
### Addendum for Open Source Projects | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to the [Major League Hacking Code of Conduct][mlh-coc], or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the [Code of Conduct][mlh-coc] may be permanently removed from the project team. | ||
|
||
The [Major League Hacking Code of Conduct][mlh-coc] applies both within project spaces and in public spaces when an individual is representing the project or its community. | ||
|
||
### Credits | ||
|
||
Inspired by [Jekyll's Code of Conduct][jekyll-coc]. | ||
|
||
[mlh-coc]: https://github.com/MLH/mlh-policies/blob/master/code-of-conduct.md | ||
[jekyll-coc]: https://github.com/jekyll/jekyll/blob/master/CONDUCT.markdown |
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": "mlh-hackathon-nodejs-starter", | ||
"version": "0.1.0", | ||
"description": "A hackathon starting point for new Nodejs applications", | ||
"scripts": { | ||
"start": "node app/index.js", | ||
"deploy": "NODE_ENV=production node app/index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"dependencies": { | ||
"body-parser": "^1.18.3", | ||
"compression": "^1.7.3", | ||
"dotenv": "^6.2.0", | ||
"express": "^4.16.4" | ||
} | ||
} |