September 2018
Intermediate to advanced
764 pages
20h 6m
English
There's one minor improvement we must make before we can do E2E testing with the API backend. At the moment, we are hard-coding the URL for our production API endpoint (localhost:8080), even though during the test, the testing URL (localhost:8888) will be used. Therefore, we need to replace this with a placeholder that we can override during build time.
First, in src/components/registration-form/index.jsx, replace the following line:
const request = new Request('http://localhost:8080/users/', {})
With this one:
const request = new Request('http://%%API_SERVER_HOST%%:%%API_SERVER_PORT%%/users/', {})
Read now
Unlock full access