https://github.com/yogyy/go-rest-api-v1.22.3
Restful API using go
https://github.com/yogyy/go-rest-api-v1.22.3
bcrypt go jwt postgresql
Last synced: about 2 months ago
JSON representation
Restful API using go
- Host: GitHub
- URL: https://github.com/yogyy/go-rest-api-v1.22.3
- Owner: yogyy
- Created: 2024-05-17T17:00:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T12:24:44.000Z (about 2 years ago)
- Last Synced: 2025-01-05T20:42:09.086Z (over 1 year ago)
- Topics: bcrypt, go, jwt, postgresql
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Learning Golang with Restful API
to run the Server use
```bash
go run *.go
```
```bash
http://127.0.0.1:8080
```
## Routes
using prefix `/api/v1/`
### Register
```json
POST /auth/register
{
"firstName": "",
"lastName": "",
"password": "6 charactest long"
}
```
### Login
```json
POST /auth/login
{
"number": number,
"password": ""
}
```
### Get all accounts
```json
GET /account
```
### Get account by id
- This endpoint requires a valid JSON Web Token (JWT) for authorization.
- Each JWT token is unique and grants access only to the account associated with the token itself.
need jwt token, each token only available to get account by token
```json
GET /account/12345 HTTP/1.1
Authorization: Bearer
```
### Delete account by id
```json
DELETE /account/{id}
```