14 lines
308 B
JavaScript
14 lines
308 B
JavaScript
|
const router = require('express').Router();
|
||
|
const Roads = require('../models/roadsModel');
|
||
|
|
||
|
router.get('', async (req, res) => {
|
||
|
try {
|
||
|
const roads = await Roads.getRoads();
|
||
|
res.status(200).json(roads);
|
||
|
} catch (e) {
|
||
|
res.status(500).json(e);
|
||
|
}
|
||
|
})
|
||
|
|
||
|
module.exports = router;
|