https://github.com/maybeizen/go-webserver
https://github.com/maybeizen/go-webserver
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maybeizen/go-webserver
- Owner: maybeizen
- Created: 2025-07-03T04:56:17.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-03T05:52:41.000Z (12 months ago)
- Last Synced: 2025-07-03T06:27:35.414Z (12 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Webserver/API
little thing im tinkering with to get better at Go
## Building
(yeah im using Node scripts to build a Go project. Shut up)
- `npm run build` - Builds a Windows executable to `./bin/webserver.exe`
- `npm run build-linux` - Builds a Linux executable to `./bin/webserver`
## Endpoints
(check out [routes.go](./internal/routes/routes.go))
- `/api/health` (GET) - Responses with `200 OK` if the server is online and responding.
- `/api/random` (GET) - Gives you a random number between 1-100.
---
- `/api/say` (POST) - Repeats whatever you say to it.
Data:
```json
{
"message": "Hello, world!"
}
```
- `/api/user` (POST) - Store a user in the remote database.
Data:
```json
{
"name": "Some name",
"email": "example@email.com",
"age": 18
}
```
- `/api/user?name=example` (DELETE) - Delete a user by name.