This commit is contained in:
Brian J Brennan 2013-03-24 16:52:09 -04:00
Родитель b92a34ea65
Коммит daa4bb8bac
7 изменённых файлов: 117 добавлений и 0 удалений

19
app.js Normal file
Просмотреть файл

@ -0,0 +1,19 @@
const path = require('path');
const http = require('http');
const express = require('express');
const app = express();
app.use(express.logger());
app.use(express.compress());
app.use(express.bodyParser());
app.use(express.static(path.join(__dirname, 'static')));
require('./controllers/auth')(app);
require('./controllers/info')(app);
require('./controllers/backpack')(app);
require('./controllers/make')(app);
if (!module.parent)
app.listen(3000);
else
module.exports = http.createServer(app);

15
controllers/auth.js Normal file
Просмотреть файл

@ -0,0 +1,15 @@
module.exports = function (app) {
app.get('/login', function (req, res, next) {
res.send('GET /login')
});
app.post('/login', function (req, res, next) {
res.send('POST /login')
});
app.post('/logout', function (req, res, next) {
res.send('POST /logout')
});
};

15
controllers/backpack.js Normal file
Просмотреть файл

@ -0,0 +1,15 @@
module.exports = function (app) {
app.get('/claim', function (req, res, next) {
res.send('GET /claim')
});
app.post('/claim', function (req, res, next) {
res.send('POST /claim');
});
app.get('/backpack', function (req, res, next) {
res.send('GET /backpack');
});
};

19
controllers/info.js Normal file
Просмотреть файл

@ -0,0 +1,19 @@
module.exports = function (app) {
app.get('/about', function (req, res, next) {
res.send('GET /about')
});
app.get('/privacy', function (req, res, next) {
res.send('GET /privacy')
});
app.get('/terms', function (req, res, next) {
res.send('GET /terms')
});
app.get('/vpat', function (req, res, next) {
res.send('GET /vpat')
});
};

48
controllers/make.js Normal file
Просмотреть файл

@ -0,0 +1,48 @@
module.exports = function (app) {
app.get('/make', function (req, res, next) {
res.send('GET /make');
});
app.param('badgeName', function (req, res, next, badgeName) {
// yep, get stuff from the db.
next();
});
app.get('/programs?/science', function (req, res, next) {
res.send('SCIENCE!!')
});
app.get('/programs?/technology', function (req, res, next) {
res.send('TECHNOLOGY!!!')
});
app.get('/programs?/engineering', function (req, res, next) {
res.send('ENGINEERING!!!')
});
app.get('/programs?/art', function (req, res, next) {
res.send('ART!!!')
});
app.get('/programs?/math', function (req, res, next) {
res.send('MATH!!!')
});
app.get('/programs?/:badgeName', function (req, res, next) {
res.send('GET /program/badge')
});
app.get('/orgs', function (req, res, next) {
res.send('GET /orgs')
});
app.param('orgName', function (req, res, next, orgName) {
// pull some stuff from the database probably
next();
});
app.get('/orgs?/:orgName', function (req, res, next) {
res.send('GET /org/name');
});
};

1
static/.gitkeep Normal file
Просмотреть файл

@ -0,0 +1 @@

0
views/.gitkeep Normal file
Просмотреть файл