1

How can I get my PORT running on 8080? Do I need to install a dependency?

const app = require('express')();
const PORT = 8080;

app.listen(
    PORT,
    () => console.log('its alive on http://localhost:${PORT}')
)

Terminal: API % node . its alive on http://localhost: ${PORT}

Phil
  • 141,914
  • 21
  • 225
  • 223

1 Answers1

2

Since you are using template literals you need to write it as

const PORT = 8080;

app.listen(
    PORT,
    () => console.log(`its alive on http://localhost:${PORT}`)
)

keyboard

See https://stackoverflow.com/a/52612901/13163131 and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals for more info

humble_barnacle
  • 382
  • 3
  • 15