Welcome to the PufferPanel community forums! If you need help please register an account and post in the Support category.

Templates for NodeJs all version



  • Hello, I recreate a Template with Template of U-siro but for all version

    For install NodeJs (latest Version) :

    sudo curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    After my JSON Template
    (Template are here : /var/lib/pufferd/templates/)

    {
      "pufferd": {
        "type": "node",
        "display": "NodeJs Server",
        "install": {
          "commands": [
            {
              "commands": [
                "npm install"
              ],
              "type": "command"
            }
          ]
        },
        "run": {
          "stop": "^C",
          "pre": [],
          "post": [],
          "arguments": [
            "start", 
            ""
          ],
          "program": "npm",
          "environmentVars": {
              "PORT": "${port}"
            }
        },
        "environment": {
          "type": "standard"
        },
        "data": {
          "port": {
            "value": "1000",
            "required": false,
            "desc": "What port to bind the server to(Effective only with process.env.PORT)",
            "display": "Port",
            "internal": false
          }
        }
      }
    }
    
    

 

7
Online

846
Users

858
Topics

3.6k
Posts