Creating the project
Creating a new Fastify project with TypeScript support is straightforward but requires adding some extra dependencies. In this section, we’ll look at the process of manually setting up a new Fastify project with TypeScript and installing the necessary dependencies.
Let’s start with the package.json
file, a configuration file for a Node.js project. It includes information about the dependencies, the entry point, and scripts. The following is just a partial snippet since we will evolve it through the sections of this chapter:
{ "version": "1.0.0", "main": "dist/server.js", // [1] "dependencies": { "@fastify/autoload": "^5.7.1", "fastify": "^4.15.0" }, "devDependencies": { "@types/node": "^18.15.11"...