I use Buffalo for an API and Vue.js with TypeScript as a frontend.
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