{"id":15936036,"url":"https://github.com/notthetup/minimal-crud","last_synced_at":"2025-04-03T19:29:09.876Z","repository":{"id":142454841,"uuid":"157141618","full_name":"notthetup/minimal-crud","owner":"notthetup","description":"Simple Web Server using Jetty","archived":false,"fork":false,"pushed_at":"2018-11-12T08:22:59.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T07:41:19.561Z","etag":null,"topics":["java","jetty","minimal","webserver"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/notthetup.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}},"created_at":"2018-11-12T01:51:06.000Z","updated_at":"2018-11-12T13:18:38.000Z","dependencies_parsed_at":"2024-05-17T14:46:33.684Z","dependency_job_id":null,"html_url":"https://github.com/notthetup/minimal-crud","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"75f50c010ba718d7cd5803e678d3f2e858e29ed9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notthetup%2Fminimal-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notthetup%2Fminimal-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notthetup%2Fminimal-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notthetup%2Fminimal-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notthetup","download_url":"https://codeload.github.com/notthetup/minimal-crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247064750,"owners_count":20877645,"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":["java","jetty","minimal","webserver"],"created_at":"2024-10-07T04:03:25.748Z","updated_at":"2025-04-03T19:29:09.846Z","avatar_url":"https://github.com/notthetup.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# minimal-crud\nSimple [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) Web Server using Jetty.\n\nIf you search around the web for examples of running a simple web server using [Jetty](https://www.eclipse.org/jetty/) all the popular results use complicated tools like [maven](https://maven.apache.org/) and [gradle](https://gradle.org/) which need gigantic configuration files, sometimes in written in XML (ugh!), lots of external dependencies (I'm looking at your [Spring Boot](https://spring.io/projects/spring-boot)) and all sorts of crud!\n\nDoes a simple CRUD based application need so much code/configuration? Why is there a need for all this magic?\n\nSo I set out to creat the simplest CRUD server using Jetty and nothing else.\n\nInspired by [jetty documentation](https://www.eclipse.org/jetty/documentation/current/embedding-jetty.html) and [simple-webserver-and-rest-with-jetty-and-no-xml](https://github.com/mcaprari/simple-webserver-and-rest-with-jetty-and-no-xml)\n\n\n## Installation\n\nYou'll need to download bunch of [Jetty jars]() to make this work.\n\nOne simpler solution is to use the [`jetty-all-uber.jar`]() which contains ALL the jetty jars.\n\nYou can get it using :\n\n\n```bash\ncurl -o jetty-all-uber.jar https://repo1.maven.org/maven2/org/eclipse/jetty/aggregate/jetty-all/9.4.12.v20180830/jetty-all-9.4.12.v20180830-uber.jar\n```\n\n## Running\n\nThis will compile and run a local server. The server by default runs on port 8080.\n\n```bash\njavac -d classes -cp jetty-all-uber.jar MinimalCrud.java \u0026\u0026 java -cp classes:jetty-all-uber.jar org.eclipse.jetty.embedded.MinimalCrud\n```\n\n\n## Accessing\n\nThe minimal Jetty server just accepts all HTTP connections and logs them and returns a [HTTP 200](https://httpstatuses.com/200) status code.\n\nThe following bits of information are logged.\n\n\t- Path\n\t- Content-Type\n\t- Body (if applicable)\n\nThese [curl](https://curl.haxx.se/) commands can help you test the server\n\n### GET\n\nGET with a simple [query string](https://en.wikipedia.org/wiki/Query_string)\n\n```bash\ncurl \"localhost:8080/foo?name=ferret\"\n```\n\nwill yield\n\n```\nGET at path : /foo\n- query string : name=ferret\n```\n\n### PUT\n\nPUT with a [x-www-form-urlencoded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) key-value pairs like a [HTML form](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Your_first_HTML_form)\n\n```bash\ncurl -X PUT -d \"{value:20}\" \"localhost:8080/foo\"\n```\n\nwill yield\n\n```\nPUT at path : /foo\n- query string : null\n- with Content-Type : application/x-www-form-urlencoded\n- Body : {value:20}\n```\n\n### POST\n\nPOST with a simple [query string](https://en.wikipedia.org/wiki/Query_string)\n\n```bash\ncurl -X POST \"localhost:8080/asdad?name=ferret\"\n```\n\nwill yield\n\n```\nPOST at path : /asdad\n- query string : name=ferret\n- Content-Type : null\n- Body :\n```\n\nPOST with a [x-www-form-urlencoded](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) key-value pairs like a [HTML form](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Your_first_HTML_form)\n\n```bash\ncurl -X POST -d \"{value:20}\" \"localhost:8080/bar/foo\"\n```\n\nwill yield\n\n```\nPOST at path : /bar/foo\n- query string : null\n- Content-Type : application/x-www-form-urlencoded\n- Body : {value:20}\n```\n\nPOST with a file attachment using [HTTP multipart formposts](https://ec.haxx.se/http-multipart.html)\n\n```bash\ncurl  -F 'name=Dan' -F data=@MinimalCrud.java \"localhost:8080/foo/bar\"\n```\n\nwill yield\n\n```\nPOST at path : /foo/bar\n- query string : null\n- Content-Type : multipart/form-data; boundary=------------------------d2cb946bff9b470e\n- Body :\n\t File part : MinimalCrud.java\n\t Text Part : name : Dan\n```\n\n\u003e Note : This is not the full body of the file, just the first part of the HTTP multipart formpost\n\n\n### DELETE\n\n```bash\n\tcurl -X DELETE \"localhost:8080/bar\"\n```\n\nwill yield\n\n```\nDELETE at path /bar\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotthetup%2Fminimal-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotthetup%2Fminimal-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotthetup%2Fminimal-crud/lists"}