Closes #204 /claim #204
This module automatically detects a Node.js project in your workspace and runs npm start
in the background when the workspace starts.
It looks for a package.json
file in the specified project directory. If found, it starts the server and logs the output to auto-npm-start.log
within that directory.
Add this to your Coder template. It will check for a project in /home/coder/project
.
module "auto_npm_start" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/thezoker/auto-npm-start/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
}
If your project is in a different location, you can specify the project_dir
variable.
module "auto_npm_start" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/thezoker/auto-npm-start/coder"
version = "1.0.0"
agent_id = coder_agent.example.id
project_dir = "/home/coder/my-awesome-app"
}
Stewi
@kunstewi
Coder
@coder