Skip to content

abdoei/go-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go HTTP Server

This is a simple HTTP server written in Go.

Usage

After running the server using go run main.go, from the browser, you can access the root at http://localhost:8080/ and the users at http://localhost:8080/users/{ID-number} after replacing {ID-number} with the user ID that you POSTed.

You can also use curl to send a request to the server:

  • Get the root path:

    curl http://localhost:8080/
  • Get a user:

    curl http://localhost:8080/users/1
  • POST a user:

    curl -X POST -d '{"name":"Ali"}' localhost:8080/users
  • DELETE a user:

    curl -X DELETE localhost:8080/users/1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages