News for hackers. Stuff that matters.
Re:Ask HN: What is your Golang web-dev tech stack? by OhSoHumble on Tuesday December 05, 2017 @03:16PM (#15855372)
I use Buffalo for an API and Vue.js with TypeScript as a frontend.
Re:Ask HN: What is your Golang web-dev tech stack? by aalhour on Tuesday December 05, 2017 @06:09PM (#15856994)
Cool. How do you serve your frontend app? Do you do it via Buffalo or nodejs?
Re:Ask HN: What is your Golang web-dev tech stack? by OhSoHumble on Tuesday December 05, 2017 @06:28PM (#15857155)
Currently? 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/cdadba6e47021ba90b7f7...

And here is the code for adding cors to Buffalo: 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 [1] https://github.com/rs/cors [2] https://github.com/gobuffalo/buffalo/issues/609