{"id":16660519,"url":"https://github.com/killme2008/ip-service","last_synced_at":"2025-03-21T17:31:30.834Z","repository":{"id":21932578,"uuid":"25256970","full_name":"killme2008/ip-service","owner":"killme2008","description":"A demo project for QCon meetup","archived":false,"fork":false,"pushed_at":"2014-10-17T16:52:55.000Z","size":652,"stargazers_count":57,"open_issues_count":0,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-13T10:29:19.126Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dagon666/rpi_SoftPwm","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/killme2008.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}},"created_at":"2014-10-15T13:59:08.000Z","updated_at":"2023-08-20T12:15:27.000Z","dependencies_parsed_at":"2022-08-17T23:40:56.591Z","dependency_job_id":null,"html_url":"https://github.com/killme2008/ip-service","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/killme2008%2Fip-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fip-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fip-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/killme2008%2Fip-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/killme2008","download_url":"https://codeload.github.com/killme2008/ip-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221817125,"owners_count":16885466,"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-12T10:29:35.096Z","updated_at":"2024-10-28T10:31:25.310Z","avatar_url":"https://github.com/killme2008.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 简介\n\n一个 Clojure 开发 REST API 的简单项目，使用 [17mon](http://tool.17mon.cn/) 提供的 IP 库提供一个 IP 地理位置信息查询。\n\n在线演示：[http://ip.fnil.net/](http://ip.fnil.net/)\n\n目录介绍:\n\n* [version-0](https://github.com/killme2008/ip-service/tree/master/version-0) `lein new compojure ip-service` 的 hello world项目\n* [version-1](https://github.com/killme2008/ip-service/tree/master/version-1) 实现基础功能\n* [version-2](https://github.com/killme2008/ip-service/tree/master/version-2) 添加单元测试，拆分模块\n* [ip-service](https://github.com/killme2008/ip-service/tree/master/ip-service) 最终“成品”，添加 Jetty Server 启动和启动脚本，以及 web driver 集成测试演示\n\n\n## 依赖\n\n* JDK 6+\n* [Leiningen](https://github.com/technomancy/leiningen)\n\n## 运行\n\n开发测试运行，进入项目目录执行下列命令\n\n```\n$ lein ring server\n```\n\n会自动打开浏览器，访问 [http://localhost:3000](http://localhost:3000) 进入主界面。\n\n除了 HTML 界面外，还提供一个 REST API，可以使用 curl 测试：\n\n```\ncurl -X GET -H 'Content-Type: application/json' \\\n    http://localhost:3000/1/ip?ip=180.117.51.245\n```\n\n进入 [ip-service](https://github.com/killme2008/ip-service/tree/master/17monipdb)， 打包成独立 jar 包运行，可以执行下列命令：\n\n```\n$ lein uberjar\n$ sh bin/start.sh\n```\n\n在 `target` 目录会生成 `ip-service-0.1.0-SNAPSHOT-standalone.jar`，单独执行这个 jar 即可，通过环境变量 `-Dip-service.db={{path_to_db}}` 来传入 IP 数据文件地址。\n\n## 运行测试\n\n单元测试:\n\n```\n$ lein test\n```\n\n集成测试依赖 Ruby ，使用 [watirwebdriver](http://watirwebdriver.com/) 框架：\n\n```\n$ ruby test_scripts/test_main.rb\n```\n\n## License\n\nIP 库的版权遵循 [17mon](http://tool.17mon.cn/) 自身协议，类库遵循各类库协议。\n\n项目源码遵循 [WTFPL – Do What the Fuck You Want to Public License](http://www.wtfpl.net/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillme2008%2Fip-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkillme2008%2Fip-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkillme2008%2Fip-service/lists"}