Proxy in Docusaurus

  Kiến thức lập trình

I have a website www.frontend.com. It uses facebook Docusaurus as frontend, and calls an external backend www.backend.com in nodejs and mongodb.

Now, I would like to enable links like https://www.frontend.com/httpOnly/openlink?useId=abcdefg&link=cn8b-tvv. When a user opens that link in a browser, it will write a record to the backend database to specify that the user clicked that link at what time, then be redirected to https://calendly.com/d/cn8b-tvv.

I don’t want to create a webpage on the www.frontend.com to do so, because that will display a webpage for a short period of time.

Does anyone know how to enable this? For instance, how to set up a proxy in Docusaurus to directly redirect https://www.frontend.com/httpOnly/openlink?useId=abcdefg&link=cn8b-tvv to https://www.backend.com/httpOnly/openlink?useId=abcdefg&link=cn8b-tvv which will save the record and undertake the redirection?

LEAVE A COMMENT