M
M
MOV_UA2021-04-12 18:48:54
Software Deployment
MOV_UA, 2021-04-12 18:48:54

Why does the request path to the axios API change?

When publishing a client application to git-pages (React + typescript+axios), when requesting an API hosted on HEROKU (Nest). When making a request, a request is sent to the server, consisting of

https://XXXX.github.io/YYYY.herokuapp.com/achieves/?month=4&year=2021

Where the first part is inserted hostname git-pages.
i.e. it should be like this
https://YYYY.herokuapp.com/achieves/?month=4&year=2021

When developing locally, everything is ok. Compiled and uploaded. Added to the request is XXXX.github.io/

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