0

I'm trying to get the Hackernews 2.0 demo up and running on my Digital Ocean droplet, but I fail.

  • npm run start spins up the server on :8080.
  • npm run build builds for production.

The defined build tasks are defined here:

  "scripts": {
    "dev": "node server",
    "start": "cross-env NODE_ENV=production node server",
    "build": "npm run build:client && npm run build:server",
    "build:client": "cross-env NODE_ENV=production webpack --config build/webpack.client.config.js --progress --hide-modules",
    "build:server": "cross-env NODE_ENV=production webpack --config build/webpack.server.config.js --progress --hide-modules"
  }

...and the entire repo is here.

But what should I execute to serve as a :80 website?

I asked on Gitter.im, on the Vue-channel, but with zero success.

Anyone?

3
  • Can we see some source code ? its very dificult to answer a question with not enough details on it Commented Oct 5, 2016 at 19:11
  • @mtsdev: I've updated the question. Commented Oct 5, 2016 at 19:14
  • check the answer. the last option its a blind shot Commented Oct 5, 2016 at 19:30

1 Answer 1

1

You don't need to execute anything special. Simply change the definiton of listen port inside the application, on line 89 of server.js

const port = process.env.PORT || 80   // << changed here

or export env Var PORT prior to start. In linux, something like

export PORT=80 && npm start

EDIT:

or even create you own start script on package.json

"start80": "cross-env NODE_ENV=production PORT=80 node server",

(maybe- i dont' know exactly how cross-env works)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.