Jump to content

Deployment Heroku


Troix88
 Share

Recommended Posts

Hello

I  have created a very simple program, that allows users to connect to server and click the message "Click me" to append some text. This appended text is visible for all connected clients:

GitLab Repo

Locally I am able to get into the directory and start node server.js on the command line, then I open the client1.html and this is all I have to do. I have come to understand, that for the deployment on Heroku there are some additional files I have to add to make it happen. So I added the Procfile with web: node server.js as its content. Then I created a package.json file with npm init. I assume what is missing is a line telling heroku which page is the starting page in my case this would be client1.html.

{
  "name": "demo",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "dependencies": {
    "ws": "^7.1.2"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "engines": {
    "node": "10.16.3"
  },
  "repository": {
    "type": "git",
    "url": "git+https://gitlab.com/Roobiks/demo.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://gitlab.com/Roobiks/demo/issues"
  },
  "homepage": "https://gitlab.com/Roobiks/demo#readme"
}

 

What else has to be done to make it happen on heroku?

 

Kind regards,

Troix88

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...