DEV Community

Leonid Rezvitsky
Leonid Rezvitsky

Posted on

Nodemon + Go App

Nodemon + Go


Background

Hey! When developing an application in the go language, it is necessary to restart it every time through the console in order to apply new changes, this is not convenient. I propose to sprinkle it. I will be using the npm nodemon package.

Start 🚀

Install nodemon globally

npm install -g nodemon
Enter fullscreen mode Exit fullscreen mode

For easy launch of the application, I will create a Makefile.

run: main.go
    nodemon --exec "go run" main.go
Enter fullscreen mode Exit fullscreen mode

Here to nodemon we pass the launch parameters and the application itself.

To run the application

make run
Enter fullscreen mode Exit fullscreen mode

Example: https://github.com/Rezvitsky/nodemon-golang-example

Top comments (0)