Closed quanganh206 closed 8 years ago
Hello, @quanganh206.
Can I see your server.go
file?
Hi @ericmdantas
You mean main.go, I try go run main.go after go get.
package main
import (
"fmt"
"github.com/quanganh206/testgo/server/routes"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/fasthttp"
)
const port string = ":3333"
func main() {
fmt.Printf("Running at %v\n", port)
e := echo.New()
routes.Init(e)
e.Run(fasthttp.New(port))
}
Right, yeah main.go
.
That's an odd error and seems to be related to either echo
or fasthttp
.
Do you have the whole project in github or somewhere I can clone?
Hi @ericmdantas,
Please find it here: https://github.com/quanganh206/testgo
My environment:
Ok, I'll be able to try it out later today.
Right, so I managed to simulate it, I'll let people from echo
know. Thanks!
The problem seems to be related to the static middleware, the simplest example fails with the error you're reporting.
Here's a repo with the same error: https://github.com/ericmdantas/echo-static
Also, if you access http://localhost:3333/api/todos
you'll get the list of todos just fine. The problem is just the static middleware.
The problem is in the following lines:
e.Use(middleware.Static(""))
e.Use(middleware.Static(dev))
But this was supposed to work, there's been an update and it was problem broken.
Thanks!
Just opened an issue on echo: https://github.com/labstack/echo/issues/496
Edit: typo
Should be fixed now, just go to the server folder and run:
go get -u ./... github.com/labstack/echo
.
Let me know how it goes.
Thanks for your help!
I try to test it work (not product old errors), but when running with client, client only say Not Found with localhost:3000. I retest with NodeJS, everything working okay. And check api in localhost:3333 it working okay as you said. But it's still not working.
Are you running it with gulp
?
Yes, I run go run main.go to start server.
After that I run gulp for client but it product not found as I mention.
That's weird.
Let me take another look.
It's working fine here, @quanganh206. I used your repo to try to reproduce, and was able to serve the app just fine.
Is there anything you modified on your end and didn't commit there?
Also, could you please share the log in your dev tools, in Chrome, for example?
I meet that, the same repos testgo as you did.
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/favicon.ico
Running Ginger Widget version 0.1.0.598 gingerEditor.min.js:21
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/
What is this ginger widget?
I use this for English Grammar :) http://www.gingersoftware.com/
Oh, ok. Not related then.
I might be able to take a closer look later today. Please, update your repo with your modifications, if you do any.
Yes, thanks @ericmdantas, wait for you.
Can you please clone this repo https://github.com/ericmdantas/echo-static and see if it works?
If should serve static and have an api in /api
. It's the smallest reproducible scenario for your case, I guess.
Hi @ericmdantas, let's me try this and feedback with you.
Hi,
I try to run golang server, client ng2 server return error like that. May I have your help with it.