Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created November 18, 2021 13:10
Show Gist options
  • Select an option

  • Save codecademydev/7dd41869a1b790804921b2d6d1080881 to your computer and use it in GitHub Desktop.

Select an option

Save codecademydev/7dd41869a1b790804921b2d6d1080881 to your computer and use it in GitHub Desktop.
Codecademy export
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const buildingMaterials = {
wood: ['plywood', '2x4s', 'cedar shingles'],
metal: ['steel girders', 'wall studs', 'rebar'],
};
app.listen(PORT, () => {
console.log(`Server is listening on port ${PORT}`);
});
app.get('/metals', (req, res, next) => {
const arrayToSend = buildingMaterials.metal;
res.send(arrayToSend);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment