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...
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...
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...
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 (
"...
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...
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....
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...
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...
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...
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...
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 ...
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...
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(...
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 ...
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...
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 ...
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...
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...
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/...
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...
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...
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...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.