4 ms·
I use Buffalo for an API and Vue.js with TypeScript as a frontend.
by OhSoHumble 9y ago
I use Buffalo for an API and Vue.js with TypeScript as a frontend.
- aalhour 9y agoCool. How do you serve your frontend app? Do you do it via Buffalo or nodejs?
- OhSoHumble 9y agoCurrently? I run them on separate ports and use axios[0] to make requests against Buffalo routes. I had to use the github.com/rs/cors[1] package with Buffalo for CORS so that Vue doesn't yell at me. So I run `buffalo dev` in one tmux pane and `yarn dev` in another. Here is what the inside of the <script> portion of a component may look like: https://gist.github.com/howdoicomputer/cdadba6e47021ba90b7f753ff72772dd https://gist.github.com/howdoicomputer/cdadba6e47021ba90b7f7... And here is the code for adding cors to Buffalo: https://gist.github.com/howdoicomputer/17366df6cd7b8208a22a879111be9784 https://gist.github.com/howdoicomputer/17366df6cd7b8208a22a8... I got that from a PR for pre-app handlers. [2] Eventually, I'll hook everything up to Nginx for deployment. [0] https://github.com/axios/axios https://github.com/axios/axios [1] https://github.com/rs/cors https://github.com/rs/cors [2] https://github.com/gobuffalo/buffalo/issues/609 https://github.com/gobuffalo/buffalo/issues/609