{"id":26018974,"url":"https://github.com/moonwave99/express-postgres-mapbox-example","last_synced_at":"2026-06-05T11:31:49.206Z","repository":{"id":142636146,"uuid":"390654889","full_name":"moonwave99/express-postgres-mapbox-example","owner":"moonwave99","description":"Express / postgres / mapbox example","archived":false,"fork":false,"pushed_at":"2021-08-10T13:53:24.000Z","size":2117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-06T06:46:51.690Z","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/moonwave99.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":"2021-07-29T08:29:49.000Z","updated_at":"2021-08-10T13:53:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bd09dab-546c-43ab-94be-87904234a38f","html_url":"https://github.com/moonwave99/express-postgres-mapbox-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moonwave99/express-postgres-mapbox-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fexpress-postgres-mapbox-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fexpress-postgres-mapbox-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fexpress-postgres-mapbox-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fexpress-postgres-mapbox-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moonwave99","download_url":"https://codeload.github.com/moonwave99/express-postgres-mapbox-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonwave99%2Fexpress-postgres-mapbox-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33939225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-03-06T06:39:52.738Z","updated_at":"2026-06-05T11:31:49.198Z","avatar_url":"https://github.com/moonwave99.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express-postgres-mapbox example\n\n![Example screenshot](/screenshot.png)\n\n## Starting\n\nFirst, create and populate the db:\n\n```\n$ createdb express-postgres-mapbox-example\n$ npm run db:init\n```\n\nThen create a `secrets.json` file with:\n\n```json\n{\n    \"DATABASE_USERNAME\": \"your database username\",\n    \"DATABASE_PASSWORD\": \"your database password\",\n    \"MAPBOX_ACCESS_TOKEN\": \"your mapbox access token\"\n}\n```\n\nFinally:\n\n```\n$ npm start\n```\n\nAnd visit http://localhost:3000!\n\n## Storing GeoJSON inside the database\n\nSince we need it just for storage and not for querying, the [`jsonb` postgres type][jsonb] is enough:\n\n```js\nfunction updateItineraryById({ id, geometry }) {\n    return db\n        .query(\n            \"UPDATE itineraries SET geometry = ($2)::jsonb WHERE id = $1 RETURNING *\",\n            [id, JSON.stringify(geometry)]\n        )\n        .then((result) =\u003e result.rows[0]);\n}\n```\n\n[jsonb]: https://www.postgresql.org/docs/12/functions-json.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonwave99%2Fexpress-postgres-mapbox-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoonwave99%2Fexpress-postgres-mapbox-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonwave99%2Fexpress-postgres-mapbox-example/lists"}