I want to know how i improve security to my react app (i using xampp to host the react app), because i believe that anyone with the source code can modify then and remove the protected routes from the code, and access all the informations, that my api was serving for one machine ip.
Here is an example how the code works:
<AuthProvider>
<Routes>
<Route path="*" element={<ErrorPage />} />
<Route
path="/test"
element={
<ProtectedRoute>
<MyComponentThatUsesAnAPI />
</ProtectedRoute>
}/>
</Routes>
</AuthProvider>
I was searching, and i see a few peoples renderizing the code on the server-side (they are using Next to do this), but i dont know if thats really works, and i dont know if a can do this hosting the server with xampp
obs: uses xampp is mandatory.
Lucas D. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.