Before running any commands in this README
, check that you are in the starter
directory in your terminal:
pwd
If you haven't already run npm install
in the root directory of this project,
you will need to now:
npm install
Start the server with nodemon:
npm run start:dev
If you get stuck at any point during the workshop, take a look at the code for the completed application.
Follow the documentation for Testing your API.
- Create a
config.js
script which uses the env-schema library- Configure it to read configuration from a
.env
file in development - Add configuration for the Fastify logger
level
andprettyPrint
options - Default the setting which you define for
level
toinfo
- Default the setting which you define for
prettyPrint
tofalse
- Override these settings in a local
.env
file
- Configure it to read configuration from a
- Import your
config.js
module inserver.js
and pass it to thebuildApp()
function - Update the
options
object in thebuildApp()
function inapp.js
to use the configuration which has been passed to it
- Generate the recipes schema in
routes.js
with the fluent-json-schema library instead of defining a raw JSON schema object.