00:01
In this question, we have to implement the get and post endpoints as described in this question.
00:06
So, we will need to use the server framework like express .js for node .js and here is the example for this code in a javascript language.
00:18
First of all, you have to write const express is equal to require express, const mongos is equal to require mongos, const app is equal to express, app use express .json, mongos connect, mongodb localhost, your database name, user new parts, const recording is equal to mongos model recording, zip number, air quality number, then app get, lab status, async, rec, res, equal to, greater than, const zip equal to rec, query.
01:10
Then after that you have to use if condition.
01:14
So, if zip return rest status 400, json error, a zip code is required, const recordings is equal to await recording find zip.
01:29
Again using for if loop...