Skip to main content

All Questions

Tagged with
2 votes
1 answer
199 views

Server (serving static reactjs files) in Docker container 404 page not found

I am trying to containerize a Go app that serves static files on port 8000. I have looked at other posts on this topic and many seem to say to use router.Run("0.0.0.0:8000") or router.Run(&...
Alfie Danger's user avatar
2 votes
0 answers
183 views

GO Gin framwork,Use embed to package front-end and back-end projects together. use the StaticFS for static resources with / prefixed routes

When using GO's Gin framework, package the front-end built dist project into the same bin scenario, and when the static resources of the front-end file are routed for requests, if it is a routing ...
youngsh's user avatar
  • 21
1 vote
1 answer
61 views

Passing the handler in route group without creating condition

I wanted to create a route group wherein I can only passed the "repo.GetUsers" only and not create an if statement, for simplicity. I'm practicing a crud application and if someone can help ...
Omega's user avatar
  • 13
3 votes
3 answers
1k views

CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin'

I am using Golang with gin-gonic/gin web framework in my backend and with React axios in my frontend. I tried to solve it for two days already, but I still get the same error below: CORS policy: ...
Vertislav's user avatar
1 vote
1 answer
233 views

cookie not saved by browser

Tried 15648070,15648070 and didn't work unfortunately :) Hi there, first time building an API with Gin, and I'm having some issues setting a cookie on my browser I mean, when viewing the request on ...
Eyal Solomon's user avatar
1 vote
1 answer
897 views

Access to fetch at 'https://abcde.eu.ngrok.io' from origin 'https://webpage.com' has been blocked by CORS policy, React and Go

I am trying to make a Post request using frontend React to my backend in Golang like this: const Posttobackend = async (values) => { try { const response = await fetch(`${API_URL}`, { ...
LupefiascoMosdef's user avatar
1 vote
2 answers
2k views

Cors React and Gin-Gonic Gin

I have run into a problem implementing cross origin resource sharing in the development environment, between a react front end and Go-lang Gin-Gonic framework, below is the console log from the ...
Duncan Ace Akello's user avatar
7 votes
5 answers
4k views

Serving react static files in golang gin-gonic using go:embed giving 404 error on reloading on frontend URL

I have built a go application using gin and go1.17. I am using go:embed to to serve static content for a SPA app built using react. (trying the approach as suggested in https://github.com/gin-contrib/...
Harsh Agarwal's user avatar
0 votes
1 answer
2k views

How to upload a file using Gin + React?

I want to upload a image file from React, doing so seems I need to store the image on the server and retrieve it from a POST request in order to modify it into a url path. Using Gin Gonic http ...
mjubilee1's user avatar
0 votes
1 answer
983 views

Could not load http://localhost:3000/js/app.jsx

I'm trying out a basic web app to get a sense of things based on the following tutorial https://www.freecodecamp.org/news/how-to-build-a-web-app-with-go-gin-and-react-cffdc473576/ So far things ...
Savvy's user avatar
  • 51
0 votes
1 answer
4k views

How to upload images to S3 via react/axios and golang/gin

I want to make functionality to post image to S3 in following steps. user upload image(s) on the screen. image files are sent to server after submitting images are uploaded to S3 in server side(...
jpskgc's user avatar
  • 757
1 vote
3 answers
5k views

axios.post request gets 404

Client side(React/axios.post) failed to post to server side api (Golang/gin) with status code 404. I want to make this post request success. Following curl success to write data in mysql table curl -...
jpskgc's user avatar
  • 757
1 vote
2 answers
3k views

Why got 404 for API endpoint with react-admin?

Created backend API use gin with go language type Post struct { ID uint `json:"id"` Title string `json:"title"` Body string `json:"body"` } func main() { // ... r := gin.Default()...
v v's user avatar
  • 653