{"id":21423219,"url":"https://github.com/lingesh15/golang-rest-server","last_synced_at":"2025-03-16T20:25:34.497Z","repository":{"id":263866566,"uuid":"891633584","full_name":"Lingesh15/Golang-REST-Server","owner":"Lingesh15","description":"Simple REST server built using the Fiber web framework in Golang.","archived":false,"fork":false,"pushed_at":"2024-11-20T17:25:15.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T07:11:24.536Z","etag":null,"topics":["golang","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lingesh15.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T17:16:54.000Z","updated_at":"2024-11-20T17:28:19.000Z","dependencies_parsed_at":"2024-11-20T18:41:12.137Z","dependency_job_id":null,"html_url":"https://github.com/Lingesh15/Golang-REST-Server","commit_stats":null,"previous_names":["lingesh15/golang-rest-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGolang-REST-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGolang-REST-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGolang-REST-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGolang-REST-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lingesh15","download_url":"https://codeload.github.com/Lingesh15/Golang-REST-Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243926675,"owners_count":20370022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","rest-api"],"created_at":"2024-11-22T21:15:07.869Z","updated_at":"2025-03-16T20:25:34.468Z","avatar_url":"https://github.com/Lingesh15.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Golang REST Server\n\nThis is a simple REST server built using the [Fiber](https://gofiber.io/) web framework in Golang. It provides a basic **To-Do List API** with endpoints to create, retrieve, update, and delete tasks.\n\n---\n\n## **Installation**\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/Lingesh15/Golang-REST-Server.git\n   ```\n2. Navigate to the project directory:\n   ```bash\n   cd Golang-REST-Server\n   ```\n3. Install dependencies:\n   ```bash\n   go mod tidy\n   ```\n4. Run the server:\n   ```bash\n   go run main.go\n   ```\n\nBy default, the server runs on `http://localhost:3000`.\n\n---\n\n## **API Endpoints**\n\n### **1. Get All To-Do Items**\n**Endpoint**: `GET /api/todos`\n\n**cURL Command**:\n```bash\ncurl -X GET http://localhost:3000/api/todos\n```\n\n**Response**:\n```json\n[\n    {\n        \"id\": 1,\n        \"body\": \"First todo\",\n        \"completed\": false\n    }\n]\n```\n\n---\n\n### **2. Create a To-Do Item**\n**Endpoint**: `POST /api/todos`\n\n**cURL Command**:\n```bash\ncurl -X POST http://localhost:3000/api/todos -H \"Content-Type: application/json\" -d \"{\\\"body\\\": \\\"This is my todo\\\"}\"\n```\n\n**Response**:\n```json\n{\n    \"id\": 1,\n    \"body\": \"This is my todo\",\n    \"completed\": false\n}\n```\n\n---\n\n### **3. Update a To-Do Item (Mark as Completed)**\n**Endpoint**: `PUT /api/todos/:id`\n\n**cURL Command**:\n```bash\ncurl -X PUT http://localhost:3000/api/todos/1 -H \"Content-Type: application/json\"\n```\n\n**Response**:\n```json\n{\n    \"id\": 1,\n    \"body\": \"This is my todo\",\n    \"completed\": true\n}\n```\n\n---\n\n### **4. Delete a To-Do Item**\n**Endpoint**: `DELETE /api/todos/delete/:id`\n\n**cURL Command**:\n```bash\ncurl -X DELETE http://localhost:3000/api/todos/delete/1 -H \"Content-Type: application/json\"\n```\n\n**Response**:\n```json\n{\n    \"message\": \"Todo deleted successfully\"\n}\n```\n\n---\n\n## **Project Structure**\n```\n.\n├── main.go      # Entry point for the server\n├── go.mod       # Module file for dependencies\n├── go.sum       # Checksum file for dependencies\n└── README.md    # Documentation\n```\n\n---\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingesh15%2Fgolang-rest-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flingesh15%2Fgolang-rest-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingesh15%2Fgolang-rest-server/lists"}