gorilla Questions

1

I had a look a this question Serving static content with a root URL with the Gorilla toolkit and used the answer from there successfully. I, though, want to declare explicitly which file I want to...
Randeerandel asked 19/1, 2017 at 7:37

3

Is it possible to execute a function before any handlers in a web application using the net/http package or any of the gorilla libraries? This would be useful, for instance, to check if the incomin...
Rameses asked 21/1, 2015 at 15:30

2

Solved

I'm a new beginner of Golang, I start learning Gorilla/Mux with JWT. I'm just success in doing register a user to MongoDB and then login. I use Postman to test. But when I try to browse to protect...
Prasad asked 24/9, 2019 at 16:20

1

I have a Nuxt 3 (^3.0.0-rc.11) frontend and a Golang Echo v4 backend API. The ssr property is set to false in the nuxt.config.ts file, so when I run npm run generate, I can serve the static generat...
Sullivan asked 5/10, 2022 at 18:42

4

Solved

i am using Gorilla Mux for writing a REST API and i am having trouble organizing my routes, currently all of my routes are defined in the main.go file like this //main.go package main import ( "...
Harvest asked 31/12, 2015 at 14:53

4

Solved

In Go, I was trying simple database connection. I need to import gorilla/mux, but I couldn't. I am using VS Code. After cd ing to my project directory, I created main.go and did run go get -u git...
Baku asked 30/4, 2020 at 9:39

4

Solved

I have an existing http server which I would like to profile. I have included _ "net/http/pprof"to my imports, and I already have http server running: router := createRouter() server := &http....
Interdiction asked 31/5, 2015 at 18:9

1

Solved

I followed this example for serving a NextJs front end single-page application using Golang and the native net/http package: import ( "embed" "io/fs" "log" "n...
Symposium asked 29/12, 2021 at 4:25

8

Solved

I have fairly simple setup here as described in the code below. But I am not able to get the CORS to work. I keep getting this error: XMLHttpRequest cannot load http://localhost:3000/signup. Res...
Sigvard asked 6/12, 2016 at 0:40

3

I am using Gorilla Websocket package to implement a websocket. conn, err := upgrader.Upgrade(w, r, nil) if err != nil { // handle error fmt.Println(err) } defer conn.Close() I am see the bel...
Curkell asked 15/12, 2020 at 15:46

1

Solved

I am publishing a Golang API for my application through Heroku. Not able to get my webapp (Flutter/Dart stack) to actually get a successful response from my api. However I am able to get a successf...
Aesthetically asked 19/11, 2021 at 0:8

4

Solved

Here is my code about a small demonstration webserver written with the Go language and the gorilla mux package : package main import ( "fmt" "github.com/gorilla/mux" "n...
Gene asked 25/4, 2017 at 14:20

2

Solved

I'm writing a handler that can take either POST or GET. As such, I want the option of being able to say: http://host/query?parm1=value&parm2=value I was assuming that Gorilla mux would then ...
Typal asked 5/9, 2017 at 1:20

3

Solved

I have a specific requirement with Gorilla mux routing where i want to add different Middlewares for different routes that are under one subrouter( GET subrouter in my case). Below is my code for r...
Xochitlxp asked 10/11, 2020 at 12:28

3

Solved

I've been using gorilla/mux for my routing needs. But I noticed one problem, when I nest multiple Subrouters it doesn't work. Here is the example: func main() { r := mux.NewRouter().StrictSlash(...
Flutter asked 11/4, 2015 at 8:53

3

Solved

I've been working on a Go project where gorilla/mux is used as the router. I need to be able to have query values associated with a route, but these values should be optional. That means that I'd ...
Routinize asked 28/7, 2017 at 16:42

1

Solved

I'm developing a websocket-based app where the frontend is in vue.js running on port 127.0.0.1:8080 and the backend is in golang running on port 127.0.0.1:3000. The frontend is suppose to communica...
Fourier asked 27/11, 2020 at 8:31

2

I'm using Go and trying to implement WebSocket in my project. while implementing this. I get "WebSocket: response does not implement HTTP.Hijacker" error. I'm new to this technology. Can ...
Claytor asked 19/7, 2020 at 12:16

5

Solved

This is my first post. I've just started learning Go and Angular and I'm attempting to connect the angular app to a go api. I've written both and am stuck identifying the root of the problem. I th...
Heindrick asked 20/11, 2017 at 20:57

3

Solved

I am trying to write a unit test using gotests and gomock to my restful service written in golang using gorilla but service fails to get variables from the url Here is my request req, err := htt...
Grabble asked 25/7, 2018 at 14:49

5

Solved

Session Variables are not maintained across request while using gorilla sessions web toolkit. When I start the server and type localhost:8100/ page is directed to login.html since session values do...
Spine asked 18/2, 2014 at 21:24

5

Solved

I am using gorilla mux for manage routing. What I am missing is to integrate a middleware between every request. For example package main import ( "fmt" "github.com/gorilla/mux" "log" "net/...
Hazel asked 5/10, 2014 at 16:5

3

Solved

I am fairly new to Go and have not been able to find any information on this, maybe it is just not possible at this time. I am trying to delete or replace a mux route (using http.NewServeMux, or g...
Barman asked 16/6, 2014 at 21:27

1

Solved

In a Golang app, I'm using gorilla/sessions with the mySQL backend to store data in a session but I'd like to store the data in the chi router context instead. How do I add auth token strings or st...
Fils asked 21/2, 2019 at 8:39

1

Solved

I am very new to Go and have found myself working with sockets as my first project. This is a redundant question, but I have failed to understand how to send a websocket update to a specific clien...
Knead asked 21/1, 2019 at 12:35

© 2022 - 2024 — McMap. All rights reserved.