go-chi

Cannot connect to graphql playground when using go-chi router

Deadly 提交于 2021-01-29 16:19:42
问题 I'm use gqlgen to create a go graphql server. In the tutorial, the default setup for localhost:8080 works fine. server.go ... func main() { srv := handler.NewDefaultServer(generated.NewExecutableSchema(generated.Config{Resolvers: &graph.Resolver{}})) http.Handle("/", playground.Handler("GraphQL playground", "/query")) http.Handle("/query", srv) log.Fatal(http.ListenAndServe(":8080", nil)) } ... However, if i switch to the Chi package router, I get a 400 error: server.go ... func main() {

vue-router in production (serving with Go)

此生再无相见时 提交于 2020-02-04 04:56:10
问题 I'd like to separate client and server completely, so I created a vuejs project with vue init webpack my-project . In this project I'm using vue-router for all my routing (this includes special paths, like /user/SOMEID .. This is my routes.js file: import App from './App.vue' export const routes = [ { path: '/', component: App.components.home }, { path: '/user/:id', component: App.components.userid }, { path: '*', component: App.components.notFound } ] When I run the application using npm run