Frontend rust fw to integrate with actix-web?

Hello there rusteceans, i'm new in rust world and so far im loving it. The thing is i wanna know if there's a way to work simultaneously both frontend and backend, you know like react & express. You can have your server running in one terminal, and the client running on another terminal(while on dev phase), then fetch your api, and then work on the gui with api data, i wanna do the same with actix, i want to consume my actix api(locally) so i can buld the gui using the api data, ¿is there any frontend fw to do that? ¿is there any way i could consume my api and develop gui while on dev?

Of course. Just bind your server to some localhost address (i.e. 127.0.0.1:8080 is a common one for testing), run it in one of your terminals and call your server from the frontend. That works with any frontend that can make HTTP calls or use websockets to interact with your actix-web server.

i tried with react using useEffect,useState to fetch and save api data like usually, and it throws error

Without the error message, it's hard to tell why your setup is not working. My initial guess would be the CORS settings.

3 Likes

yes i had to configure the cors, didn't know that, noob mistake

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.