{"id":16119540,"url":"https://github.com/downgoon/hello-world-jresty","last_synced_at":"2025-06-12T12:07:30.920Z","repository":{"id":77273879,"uuid":"98413420","full_name":"downgoon/hello-world-jresty","owner":"downgoon","description":"a demo web-app based on jresty","archived":false,"fork":false,"pushed_at":"2017-07-26T12:27:42.000Z","size":7502,"stargazers_count":1,"open_issues_count":0,"forks_count":7,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T02:23:45.420Z","etag":null,"topics":["java-web-app","jresty","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/downgoon.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":"2017-07-26T11:00:42.000Z","updated_at":"2017-10-10T11:16:15.000Z","dependencies_parsed_at":"2023-05-25T12:00:22.531Z","dependency_job_id":null,"html_url":"https://github.com/downgoon/hello-world-jresty","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/downgoon%2Fhello-world-jresty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/downgoon%2Fhello-world-jresty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/downgoon%2Fhello-world-jresty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/downgoon%2Fhello-world-jresty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/downgoon","download_url":"https://codeload.github.com/downgoon/hello-world-jresty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886331,"owners_count":21177645,"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-web-app","jresty","ssh"],"created_at":"2024-10-09T20:54:24.646Z","updated_at":"2025-04-14T13:14:04.604Z","avatar_url":"https://github.com/downgoon.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello-world-jresty\n\n## how to run\n\n### for users\n\n``` bash\n$ wget https://github.com/downgoon/hello-world-jresty/files/1176518/hello-world-jresty-1.1.0.tar.gz\n$ tar zxvf hello-world-jresty-1.1.0.tar.gz\n$ cd hello-world-jresty-1.1.0\n\n$ jresty start\njresty web app is listening on 8080 ...\n\n$ curl http://localhost:8080/jresty/ping.json -i\nsome json response\n\n$ jresty stop\n```\n\nif the port ``8080`` is already used by others, you can change the listening port in  ``hello-world-jresty-1.1.0/tomcat/conf/server.xml``\n\n\n``` xml\n\u003cConnector port=\"8080 -\u003e ${port}\" protocol=\"HTTP/1.1\"\n               connectionTimeout=\"20000\"\n               redirectPort=\"8443\" /\u003e\n```\n\n\n### for developers\n\n- run in ``eclipse`` or ``IntelliJ IDEA``\n\n\t``org.example.jresty.runner.JettyEmbedRunner``\n\n- run with maven\n\n``` bash\n\n# in rd env (development environment)\nmvn -Djetty.port=8080 jetty:run -Dmaven.test.skip=true -Prd\n\n# in op env (production environment)\nmvn -Djetty.port=8080 jetty:run -Pop\n```\n\n## how to access\n\n## multi representation\n\n``` bash\ncurl http://localhost:8080/jresty/ping.json -i\ncurl http://localhost:8080/jresty/ping.jsonp -i\ncurl http://localhost:8080/jresty/ping.xml -i\ncurl http://localhost:8080/jresty/ping.html -i\ncurl http://localhost:8080/jresty/ping.jsp -i\n```\n\n``redirect`` support for ``.html`` or ``.jsp``\n\n```\n$ curl http://localhost:8080/jresty/ping.jsp?redirect=http://www.baidu.com -i\nHTTP/1.1 302 Found\nContent-Language: zh-cn\nAccess-Control-Allow-Origin: *\nAccess-Control-Allow-Credentials: true\nLocation: http://www.baidu.com?status=200\u0026message=OK\nContent-Length: 0\nServer: Jetty(7.2.0.v20101020)\n\n$ curl http://localhost:8080/jresty/ping.html?redirect=http://www.baidu.com -i\n\n```\n\n## two URLs for one method\n\n``` bash\n# GET ping.json is equal to GET ping-index.json\n# POST ping.json is equal to GET ping-create.json\n# DELETE ping.json is equal to GET ping-remove.json\n# PUT ping.json is equal to GET ping-update.json\n# GET ping/ABC.json is equal to GET ping-view.json?id=ABC\n\n$ curl http://localhost:8080/jresty/ping.json -i\n$ curl http://localhost:8080/jresty/ping-index.json -i\n```\n\n## some examples\n\n``` bash\n$ curl http://localhost:8080/jresty/ping.json -i\n\tHTTP/1.1 200 OK\n\tContent-Language: zh-cn\n\tAccess-Control-Allow-Origin: *\n\tContent-Length: 97\n\tContent-Type: application/json;charset=UTF-8\n\tCache-Control: max-age=0\n\tServer: Jetty(7.2.0.v20101020)\n\n$ curl http://localhost:8080/jresty/ping.xml -i\n\tHTTP/1.1 200 OK\n\tContent-Language: zh-cn\n\tAccess-Control-Allow-Origin: *\n\tContent-Length: 200\n\tContent-Type: application/xml;charset=UTF-8\n\tCache-Control: max-age=0\n\tServer: Jetty(7.2.0.v20101020)\n\n\t\u003cio.downgoon.jresty.rest.model.UnifiedResponse\u003e\n  \t\t\u003cstatus\u003e200\u003c/status\u003e\n  \t\t\u003cmessage\u003eOK\u003c/message\u003e\n  \t\t\u003cdebug\u003e20161218152559257318:系统正在运行\u003c/debug\u003e\n\t\u003c/io.downgoon.jresty.rest.model.UnifiedResponse\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdowngoon%2Fhello-world-jresty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdowngoon%2Fhello-world-jresty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdowngoon%2Fhello-world-jresty/lists"}