Skip to content

sovrn/fastify-template-server

 
 

Repository files navigation

Fastify Template Server

Maintenance Code Coverage Build Status Fork Ask Me Anything !

Description

A template fastify server with basic functionality and structure ready to fork and spin up a server.

Contents

This repository is ready for start developing. You can find controllers folders where you can register routes and start creating your api.

Inside this repo you can find spec test files. In package.json it is specified 100% coverage you can tweak this number to meet your needs.

In the root folder there is also two Dockerfiles, one for development Dockerfile.dev and the Dockerfile for production.

Finally you can find to env files, .env.production and .env.dev. Depending on the environment you start your server you pull the appropriate env values.

Usage

Locally

In order to run this server locally you need to install dependencies with npm install and then npm run start.

Docker

Build Image:

docker build . -t fastify-template
# or the dev image
docker build . -f Dockerfile.dev -t fastify-template

Run Development Image

You can run development Docker and develop your code in two ways

docker run -p <host-port>:<server-port> --name fastify-template fastify-template
# or with live reload support
docker run -p <host-port>:<server-port> --name fastify-template -v /app/node_modules -v ${PWD}:/app fastify-template

Run Production Image

docker run -p <host-port>:<server-port> --name fastify-template fastify-template

License

MIT License

✌️ For any questions or issues ✌️

About

Template for spinning up a fastify server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 86.4%
  • JavaScript 8.7%
  • Dockerfile 3.8%
  • Shell 1.1%