I'm structuring my code to become more readable and maintainable at the same time.
here is my GET.articles and my INSERT.articles is just the same with this.
const express = require('express');
const router = express.Router();
router.get('/sample', (req, res) => {
res.send("Nice")
})
module.exports = router;
my index.js
const GET_articles = require('./GET.articles');
const INSERT_articles = require('./INSERT.articles');
exports { GET_articles, INSERT_articles}
and I import it like this:
app.use('/example', require('./routes/articles_controller/index'));
This is my error:
SyntaxError: Unexpected token export