user6060672
user6060672

Reputation:

Running go webserver on Cloud9 IDE

im kinda confused on how to run a go lang webserver on Cloud9IDE.. This is my simple go server i am attempting to run:
https://ide.c9.io/amanuel2/golangpractice

I tried to click run then went to the url it wants me to go but it told me 404 not found... And i also saw this is the output in the command line when i click run on cloud9:

Your code is running at https://golangpractice-amanuel2.c9users.io.
Important: use os.Getenv(PORT) as the port and os.Getenv(IP) as the host in your scripts!

2016/03/14 11:45:51 Listening on port 8080 ... 

Please help!

Upvotes: 1

Views: 470

Answers (1)

Brady Dowling
Brady Dowling

Reputation: 5522

The 404 you're seeing is from line 142 of webserver.go so your app actually is running properly. From your code, it looks like you have a route for /item/name so try going to https://golangpractice-amanuel2.c9users.io/item/name and you'll get something there.

All other routes are giving 404's because of line 142.

Upvotes: 3

Related Questions