C
C
CodeVision2022-02-21 18:28:52
Express.js
CodeVision, 2022-02-21 18:28:52

How to remove a port from a domain?

I have a Freenom domain, how can I switch to a domain without specifying a port?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
black1277, 2022-02-21
@CodeVision

If you really have EXPRESS.JS, then the code should contain approximately the following lines:

import express from 'express'
...
const app = express()
const PORT = process.env.PORT || 8080
...
app.listen(PORT, () => {
  console.log('Server has been started on port ...')
})

instead of the number 8080, enter 80 If it does not help, look for the PORT variable in the .env environment files and change it there. If nothing helps at all, then change it directly in the code
app.listen(80, () => {
  console.log('Server has been started on port ...')
})

It seems that I teach bad things :) But sometimes, it is useful for understanding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question