TypeScript Full Stack project (Part III) - NestJS, the server-side
David (ダビッド )
Posted on February 1, 2020
The previous post showed the client-side part. Now, we are going to create the server-side using NestJS. That team has done a very great job with the framework but also has awesome documentation as well. If you still not knowing NestJS, I strongly recommend you to take a look.
Server-side
Let's go to create the NestJS application that we use it as server-side part using its CLI and the following options:
- package-manager: npm. I prefer npm than yarn and I am using it inside the rest of the project.
odin@asgard:~/issues $ nest new server --package-manager npm
The new folder structure will contain a new folder server, with the NestJS application.
issues
├── client
├── .git
├── .gitignore
├── package.json
└── server
To start the server from the parent folder, issues, we are going to modify the package.json adding a new start:server script.
{
...
"scripts": {
"start:server": "npm start --prefix ./server"
},
...
}
Now we are able to start the NestJS application:
odin@asgard:~/issues $ npm run start:server
Because of the purpose of this post is not to build a NestJS application, you can get the server-side code from this repository.
If you want to know more about how to use the NestJS CLI, Kamil Mysliwiec has written a very interesting post.
In the next post, I am going to explain how to create the shared libraries part.
Posted on February 1, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 5, 2024
September 10, 2024
September 18, 2024