Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 849 Bytes

File metadata and controls

32 lines (24 loc) · 849 Bytes

Fastify with Mongo in TypeScript

This is a fastify with mongo starter project in typescript.

The projects follows the plugins & controllers/models architecture. You can find two plugin in the plugins folder. The buildFastifyEnvPlugin links the .env file to the fastify server and the connectToDbPlugin connects the server to your Mongo Atlas Cluster.

Installation

$ git clone https://github.com/imevanc/fastify-typescript-mongo-starter.git
$ cd fastify-typescript-mongo-starter
$ npm run install

Development

You need to create a .env file in the root of your project and populate it with the following entries.
NODE_ENV=
MONGO_URL=
MONGO_DB_NAME=
MONGO_COLLECTION_NAME=
HTTP_PORT=
HTTP_HOST=
You can run the project with hot reload.
$ npm run dev