stub auth routes and controllers

This commit is contained in:
Sorrel Bri 2020-01-09 17:44:58 -08:00 committed by sorrelbri
parent 118989a9cc
commit 85ebffcdcf
4 changed files with 34 additions and 0 deletions

View file

@ -0,0 +1,14 @@
const signUp = (req, res, next) => {
}
const login = (req, res, next) => {
}
module.exports = {
signUp,
login
}

View file

@ -0,0 +1,6 @@
const express = require('express');
const router = express.Router();
// router.get('/', );
module.exports = router;

View file

@ -0,0 +1,9 @@
const express = require('express');
const router = express.Router();
const authController = require('../controllers/auth');
router.post('/signup', authController.signUp);
router.post('/login', authController.login);
module.exports = router;

View file

@ -14,6 +14,8 @@ dotenv.config();
const indexRouter = require('./routes/index'); const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users'); const usersRouter = require('./routes/users');
const authRouter = require('./routes/auth');
const apiRouter = require('./routes/api');
const app = express(); const app = express();
@ -34,6 +36,9 @@ app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter); app.use('/', indexRouter);
app.use('/users', usersRouter); app.use('/users', usersRouter);
app.use('/auth', authRouter);
// @auth
app.use('/api', apiRouter);
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {