Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. App Packaging & Development
  3. Question about packaging express.js node apps

Question about packaging express.js node apps

Scheduled Pinned Locked Moved Solved App Packaging & Development
6 Posts 3 Posters 977 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have an app I built that I am trying to package for Cloudron and it doesn't seem to run the health check once the server runs. Anyone else run into this?

    Screen Shot 2020-11-01 at 1.33.28 AM.png

    Funny enough, it works if I go into recovery mode, go to the terminal, and start the server in there manually.

    1 Reply Last reply
    0
    • nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by
      #2

      You express server has to have a route handler for the healthcheck route mentioned in the CloudronManifest.json which responds with any 2** status code on a GET request.

      As an example the surfer app is also an express.js based one and it looks like this: https://git.cloudron.io/cloudron/surfer/-/blob/master/server.js#L87

      Don't forget to update the CloudronManifest.json to mention the /healthcheck route path you settle on.

      ? 2 Replies Last reply
      0
      • nebulonN nebulon

        You express server has to have a route handler for the healthcheck route mentioned in the CloudronManifest.json which responds with any 2** status code on a GET request.

        As an example the surfer app is also an express.js based one and it looks like this: https://git.cloudron.io/cloudron/surfer/-/blob/master/server.js#L87

        Don't forget to update the CloudronManifest.json to mention the /healthcheck route path you settle on.

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @nebulon oh whoops! Makes sense. I’ll add that route. Thanks 🙏

        1 Reply Last reply
        0
        • nebulonN nebulon

          You express server has to have a route handler for the healthcheck route mentioned in the CloudronManifest.json which responds with any 2** status code on a GET request.

          As an example the surfer app is also an express.js based one and it looks like this: https://git.cloudron.io/cloudron/surfer/-/blob/master/server.js#L87

          Don't forget to update the CloudronManifest.json to mention the /healthcheck route path you settle on.

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #4

          @nebulon Sorry just a followup. So I have the health check passing now but it seems to fail to properly serve the static files until I put it in recovery mode and manually run "node server.js" from the web terminal

          I suspect this may have something to do with permissions used to run node or permissions for the static files.

          murgeroM 1 Reply Last reply
          0
          • ? A Former User

            @nebulon Sorry just a followup. So I have the health check passing now but it seems to fail to properly serve the static files until I put it in recovery mode and manually run "node server.js" from the web terminal

            I suspect this may have something to do with permissions used to run node or permissions for the static files.

            murgeroM Offline
            murgeroM Offline
            murgero
            App Dev
            wrote on last edited by
            #5

            @atrilahiji In the start.sh - you gotta use the full path to node or open a bash shell I think. I had a similar issue as well a long time ago.

            --
            https://urgero.org
            ~ Professional Nerd. Freelance Programmer. ~

            ? 1 Reply Last reply
            1
            • murgeroM murgero

              @atrilahiji In the start.sh - you gotta use the full path to node or open a bash shell I think. I had a similar issue as well a long time ago.

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              @murgero HAH! Oddly enough making my script specifically cd into the backend directory and running the server.js there instead of running server.js from outside that directory did it. Unsure why. Works now and I have 0.1.1 of my app released and 0.1.0 of the cloudron integration. Thanks guys! 🙂

              1 Reply Last reply
              3
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search