Near-Earth-Object Lookup
This tool will show you the near-earth-asteroids that are making a close pass on each day for the coming week. The tool has the ability to show NEOs for any date or a date range, so let's build that out together, fren.
- clone
npm i
- get a NASA API key here
- setup
.env
file to match the example.env.default
format using the NASA API you acquired npm start
- navigate to
localhost:3000
in a browser
The app uses express/pug as a backend to spin up locally.
- The
routes/index.js
file handles the request tolocalhost:3000
-- gets the API data, stringifies it, and passes it via express arg toindex.pug
- The
views/index.pug
file handles the UI of the page, but it also extendsviews/layout.pug
-- which is important... - The
views/layout.pug
file importspublic/javascripts/main.js
(which is where most of our display/transform logic lives) and parses the JSON data string back into a JSON object (because I can't figure out how to pass an object vs a string as a param from express -> pug...) - The
public/javascripts/main.js
file handles the logic to transform the data into UI elements for display
Data sourced from this API from JPLs database