const express = require('express');
const route = express.Router();
route.get('/', (req, res) => {
res.send('Hello from student!');
});
route.get('/create', (req, res) => {
res.send('Hello from create route!');
});
route.get('/list', (req, res) => {
res.send('Hello from list route!');
});
module.exports = {
route
};
const express = require('express');
const studentRoute = require('./student').route;
const routes = express.Router();
routes.use('/student', studentRoute);
module.exports = {
routes
};
const express = require('express');
const {routes} = require('./routes/index');
const app = express();
const port = process.env.PORT || 3000;
app.use('/', routes);
app.listen(port, () => {
console.log(`Server started on port ${port}`);
});