{"id":21770227,"url":"https://github.com/jonathan-foucher/zap-api-example","last_synced_at":"2025-07-14T21:40:47.832Z","repository":{"id":263208517,"uuid":"889675689","full_name":"jonathan-foucher/zap-api-example","owner":"jonathan-foucher","description":"An example of Zig API with Zap","archived":false,"fork":false,"pushed_at":"2025-05-07T12:45:52.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T13:46:13.929Z","etag":null,"topics":["zap","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":false,"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/jonathan-foucher.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,"zenodo":null}},"created_at":"2024-11-16T23:30:07.000Z","updated_at":"2025-05-07T12:45:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"d54d92ec-a4a2-4fed-8c04-fca9e860774b","html_url":"https://github.com/jonathan-foucher/zap-api-example","commit_stats":null,"previous_names":["jonathan-foucher/zap-api-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonathan-foucher/zap-api-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fzap-api-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fzap-api-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fzap-api-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fzap-api-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathan-foucher","download_url":"https://codeload.github.com/jonathan-foucher/zap-api-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathan-foucher%2Fzap-api-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265353328,"owners_count":23751932,"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":["zap","zig"],"created_at":"2024-11-26T14:11:46.969Z","updated_at":"2025-07-14T21:40:47.823Z","avatar_url":"https://github.com/jonathan-foucher.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\nThis project is an example of a Zig API using Zap, libpq and a postgres database.\n\n## Run the project\n### Database\nInstall postgres locally or run it through docker with :\n```\ndocker run -p 5432:5432 -e POSTGRES_DB=my_database -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres\n```\n\n### Application\nOnce the postgres database is started, you can build and start the Zig project and try it out.\n\nBuild the application\n```\nzig build\n```\n\nStart the application (built executable)\n```\nzig-out/bin/zap_api_example\n```\n\nGet all the movies\n```\ncurl --location 'http://localhost:3000/api/movies'\n```\n\nSave a movie\n```\ncurl --request POST \\\n  --url http://localhost:3000/api/movies \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n\t\"id\": 26,\n\t\"title\": \"Some movie title\",\n\t\"release_date\": \"2022-02-26\"\n}'\n```\n\nDelete a movie\n```\ncurl --request DELETE \\\n  --url http://localhost:3000/api/movies/26\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathan-foucher%2Fzap-api-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathan-foucher%2Fzap-api-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathan-foucher%2Fzap-api-example/lists"}