Skip to content

Commit

Permalink
Refactor auth router
Browse files Browse the repository at this point in the history
  • Loading branch information
AntKovachev committed Dec 3, 2024
1 parent a3b6a1e commit 29fab5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 0 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ app.use(express.json());
app.use(taskRoutes);
app.use(authRoutes);

app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});

app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});
10 changes: 4 additions & 6 deletions routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ const path = require('path');
const userController = require('../controllers/userController');
const router = express.Router();

router.get('/register', (req, res) => {
res.sendFile(path.join(__dirname, '../register.html'));
});
router.get('/', (req, res) => res.sendFile(path.join(__dirname, '../index.html')));

router.get('/register', (req, res) => res.sendFile(path.join(__dirname, '../register.html')));
router.post('/register', userController.register);

router.get('/login', (req, res) => {
res.sendFile(path.join(__dirname, '../login.html'));
});
router.get('/login', (req, res) => res.sendFile(path.join(__dirname, '../login.html')));
router.post('/login', userController.login);

module.exports = router;

0 comments on commit 29fab5a

Please sign in to comment.