{"id":23024727,"url":"https://github.com/oss/placequery","last_synced_at":"2025-04-02T19:41:31.867Z","repository":{"id":20442362,"uuid":"23719247","full_name":"oss/placequery","owner":"oss","description":"Simple Node.js web server interface to the Rutgers building index.","archived":false,"fork":false,"pushed_at":"2014-11-10T01:33:11.000Z","size":340,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-08T10:21:18.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oss.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}},"created_at":"2014-09-05T21:41:47.000Z","updated_at":"2017-07-07T16:10:45.000Z","dependencies_parsed_at":"2022-07-31T19:48:07.288Z","dependency_job_id":null,"html_url":"https://github.com/oss/placequery","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/oss%2Fplacequery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oss%2Fplacequery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oss%2Fplacequery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oss%2Fplacequery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oss","download_url":"https://codeload.github.com/oss/placequery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246882993,"owners_count":20849364,"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-12-15T13:20:58.359Z","updated_at":"2025-04-02T19:41:31.503Z","avatar_url":"https://github.com/oss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"placequery\n==========\nSimple node.js web server that acts as an interface to the [placesindex] (https://github.com/oss/placesindex) completer.\n\nAccepts GET requests as queries and uses the [JSend](http://labs.omniti.com/labs/jsend) spec for responses.\n\n## Setup\nMake a copy of `config.yaml.sample`, adjust it to suit your server configuration, and save it as `config.yaml` in the\nsame directory as `placequery.js`.\n\n#### Permissions\nYou may need to start the server as root to bind to a certain port or read SSL keys on startup. If you start the\nserver with `sudo`, it will automatically set its UID and GID to that of the user who ran `sudo` after reading the\nkeys and binding to a port. Alternatively, you can define a UID and GID for the server to use in `config.yaml`.\n\n#### SSL\nEncryption is desirable if you believe certain requests to the server will reveal a user's geographic location.\n\nTo enable SSL directly, set `server.ssl.enabled` to `true` in `config.yaml` and provide paths for the `key` and `cert`\nfiles, where `key` contains the private key of the server in PEM format and `cert` contains the certificate key of the\nserver in PEM format. If you need more details, see the [Node.js SSL documentation](http://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener).\n\nAlternatively, see [Integration with web service](#integration) for a way to tunnel traffic between the end user and a host already configured for HTTPS.\n\n## Usage\nQueries are made with GET requests to the server's root directory, e.g. [http://localhost:8080/?search=hill](). To make \nnicer requests like [http://localhost/pq?search=hill](), see [Integration with web service](#integration).\n\n##### Search by title, building code, or ID\n[http://localhost/pq?search=old]() returns:\n```javascript\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"places\": [\n            {\n                \"title\": \"Old Gibbons Garage\",\n                \"id\": \"8435_5455Old Gibbons Garage\"\n            },\n            {\n                \"title\": \"Old Queens\",\n                \"id\": \"3000_4595Old Queens\"\n            }\n        ]\n    }\n}\n```\n\n##### Search by location\n[http://localhost/pq?latitude=40.498760\u0026longitude=-74.446266]() returns:\n```javascript\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"places\": [\n            {\n                \"title\": \"Old Queens\",\n                \"id\": \"3000_4595Old Queens\"\n            },\n            {\n                \"title\": \"Geology Hall\",\n                \"id\": \"3002_4597Geology Hall\"\n            },\n            {\n                \"title\": \"Van Nest Hall\",\n                \"id\": \"3001_4596Van Nest Hall\"\n            },\n            ...\n        ]\n    }\n}\n```\n\n##### Get single place\nWith IDs returned in the search results you can get the full JSON entry for a particular building.\n\n[http://localhost/pq?id=3000_4595Old%20Queens]() returns:\n```javascript\n{\n    \"status\": \"success\",\n    \"data\": {\n        \"place\": {\n            \"title\": \"Old Queens\",\n            \"description\": \"Old Queens, originally called the Queens Building...\",\n            \"cid\": \"C71741\",\n            \"building_id\": \"4595\",\n            \"building_number\": \"3000\",\n            \"campus_code\": \"10\",\n            \"campus_name\": \"College Avenue\",\n            \"location\": {\n              ...\n            },\n            \"offices\": [\n              ...\n            ],\n            \"id\": \"3000_4595Old Queens\"\n        }\n    }\n}\n```\n\n#### \u003ca name=\"integration\"\u003e\u003c/a\u003eIntegration with web service\nYou can make the placequery server look like it's part of your Apache service by adding something like this to your \n`httpd.conf` (adjust the port and domain to match the settings in `config.yaml`):\n```\nProxyPass /pq http://localhost:8080/\n```\nMake sure these lines are present and uncommented:\n```\nLoadModule proxy_module modules/mod_proxy.so\nLoadModule proxy_http_module modules/mod_proxy_http.so\n```\nNow you can make requests with [http://localhost/pq?search=hill]() instead of [http://localhost:8080/?search=hill]().\n\nThis is also an easy way to provide SSL capability for placequery: add the ProxyPass directives to the configuration\nof an HTTPS-enabled (virtual) host, and traffic between the end user and your gateway server will be encrypted.\nEnsure that backend communications between the gateway and placequery server are safe.\n\nSee Apache's [mod proxy](http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass) documentation for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foss%2Fplacequery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foss%2Fplacequery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foss%2Fplacequery/lists"}