geographic.js 340 Bytes
Newer Older
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
1 2
import city from './geographic/city.json';
import province from './geographic/province.json';
3

ζ„šι“'s avatar
ζ„šι“ committed
4
function getProvince(req, res) {
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
5
  res.json(province);
6 7
}

ζ„šι“'s avatar
ζ„šι“ committed
8
function getCity(req, res) {
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
9
  res.json(city[req.params.province]);
10 11 12
}

export default {
ζ„šι“'s avatar
ζ„šι“ committed
13 14
  'GET /api/geographic/province': getProvince,
  'GET /api/geographic/city/:province': getCity,
15
};