You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2023. It is now read-only.
Here we use `HashRouter` instead of `Router` directive because we need the server-side render at first, `/path` will be an invalid route for Rails while `/#path` will be manipulated by frontend.
224
234
225
235
236
+
And we'll created three React components to get the job done:
Here we use a javascript package named `axios` to do Ajax requests, and it's easy to handle. You can install it by yarn:
245
+
246
+
```bash
247
+
yarn add axios
248
+
```
249
+
250
+
### Server side changes
251
+
252
+
Now we need set up Rails server to request APIs of our Go application, so we need to add CORS configuration to the Go server to make cross domains access. Because we use the Gin framework by default, so we choose a cors package for the Gin: github.com/gin-contrib/cors.
253
+
254
+
We just use its default configuration that allows all the Orgins can access our Go server for testing easily, here's [the details](https://github.com/gin-contrib/cors#default-allows-all-origins).
0 commit comments