From 6fef68d9bac316abc1afecbfa2e83622f2822f0a Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Thu, 9 Jan 2020 17:44:58 -0800 Subject: [PATCH] stub auth routes and controllers --- packages/play-node-go/server/controllers/auth.js | 14 ++++++++++++++ packages/play-node-go/server/routes/api.js | 6 ++++++ packages/play-node-go/server/routes/auth.js | 9 +++++++++ packages/play-node-go/server/server.js | 5 +++++ 4 files changed, 34 insertions(+) diff --git a/packages/play-node-go/server/controllers/auth.js b/packages/play-node-go/server/controllers/auth.js index e69de29..61f3a26 100644 --- a/packages/play-node-go/server/controllers/auth.js +++ b/packages/play-node-go/server/controllers/auth.js @@ -0,0 +1,14 @@ + + +const signUp = (req, res, next) => { + +} + +const login = (req, res, next) => { + +} + +module.exports = { + signUp, + login +} \ No newline at end of file diff --git a/packages/play-node-go/server/routes/api.js b/packages/play-node-go/server/routes/api.js index e69de29..ad2d759 100644 --- a/packages/play-node-go/server/routes/api.js +++ b/packages/play-node-go/server/routes/api.js @@ -0,0 +1,6 @@ +const express = require('express'); +const router = express.Router(); + +// router.get('/', ); + +module.exports = router; diff --git a/packages/play-node-go/server/routes/auth.js b/packages/play-node-go/server/routes/auth.js index e69de29..d19c502 100644 --- a/packages/play-node-go/server/routes/auth.js +++ b/packages/play-node-go/server/routes/auth.js @@ -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; diff --git a/packages/play-node-go/server/server.js b/packages/play-node-go/server/server.js index 7eb4dfc..427012a 100644 --- a/packages/play-node-go/server/server.js +++ b/packages/play-node-go/server/server.js @@ -14,6 +14,8 @@ dotenv.config(); const indexRouter = require('./routes/index'); const usersRouter = require('./routes/users'); +const authRouter = require('./routes/auth'); +const apiRouter = require('./routes/api'); const app = express(); @@ -34,6 +36,9 @@ app.use(express.static(path.join(__dirname, 'public'))); app.use('/', indexRouter); app.use('/users', usersRouter); +app.use('/auth', authRouter); +// @auth +app.use('/api', apiRouter); // catch 404 and forward to error handler app.use(function(req, res, next) {