How do I hide a REST API Url from the end user?

后端 未结 7 1996
庸人自扰
庸人自扰 2021-02-07 15:13

Is it possible to hide my REST URL that I using via AJAX to populate page data? I don\'t want others taking and consuming from my REST API, but need to use it to display content

7条回答
  •  时光取名叫无心
    2021-02-07 16:10

    Try rendering the HTML server-side (if you think you have high server capacity). If the HTML is pre-rendered the API calls are not visible to the end user.

    If you are using:

    1. React - https://www.freecodecamp.org/news/server-side-rendering-your-react-app-in-three-simple-steps-7a82b95db82e/

    2. Angualar - https://angular.io/guide/universal

    Frameworks like Django by default do server side rendering.

    -> Server side rendering may cause load on the server compared to client-side rendering.

提交回复
热议问题