{"id":28220595,"url":"https://github.com/hrosicka/simpleserver","last_synced_at":"2025-06-11T15:31:02.023Z","repository":{"id":293664261,"uuid":"984737060","full_name":"hrosicka/SimpleServer","owner":"hrosicka","description":"SimpleServer is a cheerful HTTP server in Go-perfect for beginners and curious coders! Get instant JSON greetings, echo your data, or try a friendly POST. Fast, minimal, and always ready to say \"hello\". 🚀👋","archived":false,"fork":false,"pushed_at":"2025-05-29T12:54:49.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T14:13:36.181Z","etag":null,"topics":["get","go","post","server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrosicka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-05-16T12:27:14.000Z","updated_at":"2025-05-29T12:54:52.000Z","dependencies_parsed_at":"2025-05-16T14:28:08.537Z","dependency_job_id":"099c2223-a48b-4e26-9426-83ab69da9a4a","html_url":"https://github.com/hrosicka/SimpleServer","commit_stats":null,"previous_names":["hrosicka/simpleserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hrosicka/SimpleServer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FSimpleServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FSimpleServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FSimpleServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FSimpleServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrosicka","download_url":"https://codeload.github.com/hrosicka/SimpleServer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrosicka%2FSimpleServer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259289271,"owners_count":22834913,"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":["get","go","post","server"],"created_at":"2025-05-18T04:15:57.945Z","updated_at":"2025-06-11T15:31:02.017Z","avatar_url":"https://github.com/hrosicka.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleServer 🚀\n\n![Go](https://img.shields.io/badge/language-Go-blue.svg)\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n![Build with Go](https://img.shields.io/badge/build-passing-brightgreen.svg)\n![Minimal size](https://img.shields.io/badge/minimal-21KB-lightgrey.svg)\n![Open Source](https://img.shields.io/badge/open--source-yes-green)\n![Say Hello!](https://img.shields.io/badge/says-hello!-orange?logo=handshake)\n![Beginner Friendly](https://img.shields.io/badge/beginner-friendly-brightgreen?logo=leaflet)\n![Minimal Dependencies](https://img.shields.io/badge/dependencies-minimal-lightgrey?logo=minutemailer)\n![MIT License](https://img.shields.io/badge/license-MIT-blue?logo=open-source-initiative)\n\nA simple HTTP server written in Go.   \nPerfect for beginners who want to learn the basics of web servers and Go programming!   \n**Let’s make your browser say “Hello” like never before!** 👋\n\n---\n\n## 🧠 Features\n- Serves HTTP requests\n- Easy to understand \n- Minimal dependencies\n\n---\n\n## 🛠️ Requirements\n\n- [Go 1.18+](https://go.dev/dl/) installed on your system\n- Internet connection (for cloning the repository)\n- (Optional) [Postman](https://www.postman.com/) or `curl` for testing POST requests\n\n---\n\n## 🎬 Getting Started\n*Don’t worry, even your grandma could run this server. Just follow these steps!*\n\n1. **Clone this repository:**\n   ```bash\n   git clone https://github.com/hrosicka/SimpleServer.git\n   ```\n   ```bash\n   cd SimpleServer\n   ```\n   \n2. **Run the server:**\n   ```bash\n   go run main.go handlers.go types.go\n   ```\n\n3. **Access the server:**\n   Open your browser and visit [http://localhost:8080](http://localhost:8080)\n\n---\n\n## 🧪 How to Test the Application \n\n### 1. Start the Server\n\nMake sure you have Go installed. Then, run the server from the project directory.\n\n---\n\n### 2. Testing GET Endpoints in the Browser\n\nServer provides two GET endpoints that can be tested directly from the browser by entering the URL. Both endpoints accept query parameters, so you can easily customize the request.\n\n#### `/hello` endpoint (GET):\n**Returns a personalized JSON greeting message. Optionally takes a name parameter via the query string.**   \n*Try changing the name for a different greeting. The server never gets tired of saying hello!*\n- Open your browser.\n- In the address bar, enter (replace ```Hanka``` with any name you like):\n\n  ```\n  http://localhost:8080/hello?name=Hanka\n  ```\n\n- **Response:** You’ll see a JSON message like:\n  ```json\n  {\n  \"message\": \"Hello Hanka!\"\n  }\n  ```\n  \n#### `/data` endpoint (GET):\n**Returns a JSON message and echoes back the provided id and type parameters.**   \n*Send your data and see it come right back at you! It’s like playing catch with a server.*\n- Open your browser.\n- In the address bar, enter (replace ```123456``` and ```user``` with any name you like):\n\n  ```\n  http://localhost:8080/data?id=123456\u0026type=user\n  ```\n\n- **Response:** You’ll see a JSON message like:\n  ```json\n  {\n     \"message\": \"Data retrieved.\",\n     \"data\": {\n       \"id\": \"123456\",\n       \"type\": \"user\"\n     }\n  }\n  ```\n  \n---\n\n### 2. Testing POST Endpoints in the Browser\n#### `/submit` endpoint (POST):\n**Accepts a JSON object with name, surname, and email in the request body. Returns a confirmation message and saves the data.**   \n*Submit your name, surname, and email. The server will remember… at least until you delete the file!*\n**With Postman:**\n\n1. Open Postman.\n2. Set the method to POST.\n3. Enter the URL:\n```http://localhost:8080/submit```\n4. Go to the Body tab, select raw, and choose JSON.\n5. Enter sample data:\n```json\n{\n    \"name\": \"Martin\",\n    \"surname\": \"West\",\n    \"email\": \"martin.west@example.com\"\n}\n```\n6. Click **Send**.\n7. You should see a JSON response like:\n```json\n{\n    \"message\": \"Data received for user Martin West (martin.west@example.com).\",\n    \"data\": {\n        \"name\": \"Martin\",\n        \"surname\": \"West\",\n        \"email\": \"martin.west@example.com\"\n    }\n}\n```\n\n**With curl:**\n```\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"name\": \"Alice\", \"surname\": \"Blue\", \"email\": \"alice.blue@example.com\"}' http://localhost:8080/submit\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrosicka%2Fsimpleserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrosicka%2Fsimpleserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrosicka%2Fsimpleserver/lists"}