A simple RESTful API that provides user profile information including ID, full name, and emoji.
- Get all user profiles
- Get a specific user profile by ID
- Create new user profiles
- Update existing user profiles
- Delete user profiles
- GET
/api/v1/users- Get all users - GET
/api/v1/users/:id- Get a specific user by ID - POST
/api/v1/users- Create a new user - PUT
/api/v1/users/:id- Update an existing user - DELETE
/api/v1/users/:id- Delete a user
Each user profile contains:
id: String identifierfullName: User's full nameemoji: An emoji representing the user
- Go 1.16 or newer
- Clone the repository
- Navigate to the project directory
- Run
go mod tidyto ensure dependencies are correctly installed
go run main.go
The API will start on http://localhost:8080
curl http://localhost:8080/api/v1/users
curl http://localhost:8080/api/v1/users/1
curl -X POST http://localhost:8080/api/v1/users \
-H "Content-Type: application/json" \
-d '{"id":"4", "fullName":"Alice Cooper", "emoji":"🎭"}'
curl -X PUT http://localhost:8080/api/v1/users/1 \
-H "Content-Type: application/json" \
-d '{"fullName":"John Smith", "emoji":"😎"}'
curl -X DELETE http://localhost:8080/api/v1/users/1