Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,53 @@
// Load the dotfiles.
require('dotenv').load({silent: true});
require("dotenv").config({ silent: true });

var express = require('express');
var express = require("express");

// Middleware!
var bodyParser = require('body-parser');
var methodOverride = require('method-override');
var morgan = require('morgan');
var bodyParser = require("body-parser");
var methodOverride = require("method-override");
var morgan = require("morgan");

var mongoose = require('mongoose');
var port = process.env.PORT || 3000;
var database = process.env.DATABASE || process.env.MONGODB_URI || "mongodb://localhost:27017";
var mongoose = require("mongoose");
var port = process.env.PORT || 3000;
var database =
process.env.DATABASE ||
process.env.MONGODB_URI ||
"mongodb://localhost:27017";

var settingsConfig = require('./config/settings');
var adminConfig = require('./config/admin');
var settingsConfig = require("./config/settings");
var adminConfig = require("./config/admin");

var app = express();
var app = express();

// Connect to mongodb
mongoose.connect(database);

app.use(morgan('dev'));
app.use(morgan("dev"));

app.use(bodyParser.urlencoded({
extended: true
}));
app.use(
bodyParser.urlencoded({
extended: true,
})
);
app.use(bodyParser.json());

app.use(methodOverride());

app.use(express.static(__dirname + '/app/client'));
app.use(express.static(__dirname + "/app/client"));

// Routers =====================================================================

var apiRouter = express.Router();
require('./app/server/routes/api')(apiRouter);
app.use('/api', apiRouter);
require("./app/server/routes/api")(apiRouter);
app.use("/api", apiRouter);

var authRouter = express.Router();
require('./app/server/routes/auth')(authRouter);
app.use('/auth', authRouter);
require("./app/server/routes/auth")(authRouter);
app.use("/auth", authRouter);

require('./app/server/routes')(app);
require("./app/server/routes")(app);

// listen (start app with node server.js) ======================================
module.exports = app.listen(port);
console.log("App listening on port " + port);
console.log("App listening on port " + port);
105 changes: 50 additions & 55 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@
{
"name": "Quill",
"description": "Registration, for hackathons!",
"env": {
"NODE_ENV": {
"description": "dev or production",
"value": "dev"
},
"JWT_SECRET": {
"description": "Long random string used to verify JWT tokens for user authentication",
"generator": "secret"
},
"ROOT_URL": {
"description": "Root URL for your registration system",
"value": "http://localhost:3000"
},
"ADMIN_EMAIL": {
"description": "Credentials for the admin user created at app initialization",
"value": "[email protected]"
},
"ADMIN_PASS": "party",
"EMAIL_ADDRESS": {
"description": "The email address that is included in the 'email us' link at the bottom of emails.",
"value": "[email protected]"
},
"HACKATHON_NAME": "Hackathon",
"TWITTER_HANDLE": {
"description": "Everything after https://twitter.com/",
"value": "hackathon"
},
"FACEBOOK_HANDLE": {
"description": "Everything after https://facebook.com/",
"value": "hackathon"
},
"EMAIL_CONTACT": {
"description": "Used to send verification, registration, and confirmation emails",
"value": "Hackathon Team <[email protected]>"
},
"EMAIL_HOST": "smtp.gmail.com",
"EMAIL_USER": "[email protected]",
"EMAIL_PASS": "password",
"EMAIL_PORT": "465",
"EMAIL_HEADER_IMAGE": "https://s3.amazonaws.com/hackmit-assets/Banner_600.jpg",
"TEAM_MAX_SIZE": {
"description": "Limits the number of users that can join a team",
"value": "4"
},
"SLACK_HOOK": {
"description": "Used to send error messages to your Slack team when the API catches an error",
"value": "https://hooks.slack.com/services/your-api-key"
}
},
"addons": [
"mongolab"
],
"keywords": ["quill", "node", "express", "mongo"]
"name": "Quill",
"description": "Registration, for hackathons!",
"env": {
"NODE_ENV": {
"description": "dev or production",
"value": "dev"
},
"JWT_SECRET": {
"description": "Long random string used to verify JWT tokens for user authentication",
"generator": "secret"
},
"ROOT_URL": {
"description": "Root URL for your registration system",
"value": "http://localhost:3000"
},
"ADMIN_EMAIL": {
"description": "Credentials for the admin user created at app initialization",
"value": "[email protected]"
},
"ADMIN_PASS": "party",
"EMAIL_ADDRESS": {
"description": "The email address that is included in the 'email us' link at the bottom of emails.",
"value": "[email protected]"
},
"HACKATHON_NAME": "Hackathon",
"TWITTER_HANDLE": {
"description": "Everything after https://twitter.com/",
"value": "hackathon"
},
"FACEBOOK_HANDLE": {
"description": "Everything after https://facebook.com/",
"value": "hackathon"
},
"EMAIL_CONTACT": {
"description": "Used to send verification, registration, and confirmation emails",
"value": "Hackathon Team <[email protected]>"
},

"EMAIL_HEADER_IMAGE": "https://s3.amazonaws.com/hackmit-assets/Banner_600.jpg",
"TEAM_MAX_SIZE": {
"description": "Limits the number of users that can join a team",
"value": "4"
},
"SLACK_HOOK": {
"description": "Used to send error messages to your Slack team when the API catches an error",
"value": "https://hooks.slack.com/services/your-api-key"
}
},
"addons": ["mongolab"],
"keywords": ["quill", "node", "express", "mongo"]
}
Loading