Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions zip-api/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ app.get('/', (req, res) => {
});


app.get('/zip/:zipcode', (req, res) => {
// fill in...
app.get("/zip/:zipcode", (req, res) => {
const zipCode = req.params.zipcode;
res.json(zipdb.byZip[zipCode]);
});


app.get('/city/:cityname', (req, res) => {
// fill in...
app.get("/city/:cityname", (req, res) => {
const cityName = req.params.cityname;
res.json(zipdb.byCity[cityName]);
});


app.listen(PORT, () => {
console.log(`zip-api is up and running on ${PORT}`);
});