15 lines
315 B
JavaScript
15 lines
315 B
JavaScript
|
const router = require('express').Router();
|
||
|
|
||
|
const Cities = require('../models/citiesModel');
|
||
|
|
||
|
router.get('', async (req, res) => {
|
||
|
try {
|
||
|
const cities = await Cities.getCities();
|
||
|
res.status(200).json(cities);
|
||
|
} catch (e) {
|
||
|
res.status(500).json(e);
|
||
|
}
|
||
|
})
|
||
|
|
||
|
module.exports = router;
|