F
F
fateseekers2020-06-20 02:25:30
Nginx
fateseekers, 2020-06-20 02:25:30

How to correctly set up Express.js routes on a dedicated server with Nginx?

At the moment, the server is configured to run the application, api and phpmyadmin.

Implemented via proxy_pass like this:
Application - /
When - /api
Phpmyadmin -/phpmyadmin

The problem occurs only with api.
The application and php work.

Express.js is connected to the database correctly, requests are being processed, but the routes are not working.

When the application calls the api, the response is html with a text like CANNOT GET /smt.

Having studied many forums, I did not understand where and how the error occurs.

How to make api routes work :( API

link: https://gitlab.com/fateseekers/gipp_api

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
McBernar, 2020-06-20
@McBernar

Your URL is site.ru/api/route. And you just catch /route.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question