brillout / wildcard-api

Functions as API.
MIT License
368 stars 14 forks source link

Problem using wildcard in a dockerized application #35

Closed worms19 closed 4 years ago

worms19 commented 4 years ago

Hi,

first of all i would like to thank you for this project which seems to have a bright future.

i have a small problem using it in a docker container,

i have a node and a react container running on port 8000 (for the node server) and 3000 for the react server.

I tried to set the first exemple from the readMe, when i run it in the browser manually it works perfectly http://localhost:8000/wildcard/myFirstEndpoint

but when i call it from react

(async () => { const {msg} = await endpoints.myFirstEndpoint(); console.log(msg); })();

the http request is http://localhost:3000/wildcard/myFirstEndpoint and i get a 404

can you give me some explanation on how the routes are build ?

you can check my repository here

https://github.com/worms19/wildcard-docker

might be helpful for a future boilerplate repo

thanks

brillout commented 4 years ago

Hi @worms19 !

Check out https://github.com/reframejs/wildcard-api#serverurl. Your frontend and backend don't run on the same port hence you have to tell Wildcard where the server lives.

Let me know if that works.

can you give me some explanation on how the routes are build ?

See, https://github.com/reframejs/wildcard-api/blob/master/docs/how-wildcard-works.md#how-wildcard-works. Let me know if something is not clear.

first of all i would like to thank you for this project which seems to have a bright future.

Thanks :-) - ideas on how I can make more people know about Wildcard?

worms19 commented 4 years ago

@brillout thanks for the quick reply

Let me know if that works.

i didn't read far enough on the documentation it works perfectly

Thanks :-) - ideas on how I can make more people know about Wildcard?

i can tell you're pretty much everywhere (reddit, medium), maybe you could try to run a demo app on a youtube videos (videos courses are quite popular nowaday) but you better have a lot of free time in front of you.

I'm gonna try to build something out of this project, i'll try to give you feedback on it

you have a star from me and good luck for the future

brillout commented 4 years ago

i can tell you're pretty much everywhere (reddit, medium), maybe you could try to run a demo app on a youtube videos (videos courses are quite popular nowaday) but you better have a lot of free time in front of you.

Yea I'm not sure how I can popularize Wildcard without spending too much time on it.

It's just silly that people are doing all this GraphQL stuff when they don't really need it. Kinda my responsibility to get to word out there that RPC is enough for like 95% of the time.

I'm gonna try to build something out of this project, i'll try to give you feedback on it

That would be awesome, I'm def looking for feedback :-)

you have a star

Thanks hehe :)