You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
349 B
17 lines
349 B
function getJson(infoType) {
|
|
const json = require(`${__dirname}/geographic/${infoType}.json`); // eslint-disable-line
|
|
return json;
|
|
}
|
|
|
|
export function getProvince(req, res) {
|
|
res.json(getJson('province'));
|
|
}
|
|
|
|
export function getCity(req, res) {
|
|
res.json(getJson('city')[req.params.province]);
|
|
}
|
|
|
|
export default {
|
|
getProvince,
|
|
getCity,
|
|
};
|
|
|