Skip to content

aalfiann/fastify-fullstack-skeleton

Repository files navigation

fastify-fullstack-skeleton

Version Build Status Coverage Status Known Vulnerabilities dependencies Status JavaScript Style Guide License
Just simple Fastify fullstack skeleton.

Features

  • Auto cache and can be configured
  • Routes with schema validation
  • Error handler for 4xx and 5xx
  • Asynchronous designed
  • HTML auto minifed

Specs

  • Fastify v3
  • Mongoose 5
  • ETA Template Engine

Usage

  1. Download this source code.
  2. Extact and go to current directory then run npm install
  3. Edit the config.js
  4. Run node server.js
  5. Done.

Then open your browser and go to

- http://localhost:3000
- http://localhost:3000/api/routes

For MongoDB Test

- POST http://localhost:3000/db/add-contact
- POST http://localhost:3000/db/edit-contact
- GET http://localhost:3000/db/get-contact/:id
- GET http://localhost:3000/db/list-contact
- GET http://localhost:3000/db/search-contact?q=<name or address>

Unit test

If you want to play unit test

npm test