{"id":16597243,"url":"https://github.com/adrianmcli/simple-server","last_synced_at":"2025-03-06T19:32:37.999Z","repository":{"id":73736858,"uuid":"61732355","full_name":"adrianmcli/simple-server","owner":"adrianmcli","description":"A simple node.js server with GET, POST, and persistence in a text file.","archived":false,"fork":false,"pushed_at":"2016-06-22T16:00:43.000Z","size":836,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T04:44:22.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/adrianmcli.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":"2016-06-22T15:57:56.000Z","updated_at":"2016-06-22T15:58:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"6eb15a0a-4419-4976-b9fd-69395e916692","html_url":"https://github.com/adrianmcli/simple-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fsimple-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fsimple-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fsimple-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmcli%2Fsimple-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianmcli","download_url":"https://codeload.github.com/adrianmcli/simple-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242274651,"owners_count":20101084,"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":[],"created_at":"2024-10-11T23:55:18.773Z","updated_at":"2025-03-06T19:32:37.973Z","avatar_url":"https://github.com/adrianmcli.png","language":"JavaScript","readme":"# A Simple Server\n\nThis is a simple node.js server that is able to take two types of requests: GET and POST.\n\nThe POST request allows the user to send up some data to the server and the server will append it to the file, `store.txt`.\n\nThe GET request allows the user to see what is inside the stored file, `store.txt`.\n\n## Trying it out\n\nYou can try it out by cloning this repo, typing `npm install` inside the directory, and then starting the server with `npm start` to run the server locally on `http://localhost:3000`.\n\n1. If you make a GET request to `http://localhost:3000/get`, you will get the default empty data as a response:\n\n```json\n{\"data\":[]}\n```\n\n2. If you make a POST request with a payload (a key of \"id\" and a value of \"1\" in this example), it will respond saying that the request succeeded.\n\n```\nPOST request successful\n```\n\n3. If you do another GET request, you'll see the following:\n\n```json\n{\"data\":[{\"id\":\"1\"}]}\n```\n\n4. If you do another POST request with {\"id\":\"2\"}, and then do another GET, you'll get this as a response:\n\n```json\n{\"data\":[{\"id\":\"1\"},{\"id\":\"2\"}]}\n```\n\n### Making POST requests with Postman\n\nIf you are using Postman, make sure to use the setting `x-www-form-encoded`. [Explanation](http://stackoverflow.com/questions/24543847/req-body-empty-on-posts)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Fsimple-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianmcli%2Fsimple-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmcli%2Fsimple-server/lists"}