E
E
evgeniy20242022-02-08 12:16:06
Node.js
evgeniy2024, 2022-02-08 12:16:06

Routing issues when deploying to heroku?

I have a server that I want to upload to heroku.
The problem is that it does not want to work, and as I found out by typing, because I connect a common router:

const router = require('./routes/index')

app.use('/api', router)

And accordingly I get such an error
6202343a5a229683107170.png

Well, if I remove this line, then everything will work and the usual app.get ('/') will be processed

How can I fix this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question