{"id":23136335,"url":"https://github.com/lastres/fizzbuzz","last_synced_at":"2026-05-15T08:04:48.943Z","repository":{"id":67927960,"uuid":"95576200","full_name":"lastres/fizzbuzz","owner":"lastres","description":"An Erlang example Fizzbuzz JSON API using Cowboy webserver","archived":false,"fork":false,"pushed_at":"2017-06-28T11:02:49.000Z","size":776,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T19:51:31.048Z","etag":null,"topics":["beam","cowboy","erlang","fizzbuzz","json","json-api","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lastres.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-27T15:58:58.000Z","updated_at":"2017-06-27T16:13:45.000Z","dependencies_parsed_at":"2023-09-11T23:47:09.909Z","dependency_job_id":null,"html_url":"https://github.com/lastres/fizzbuzz","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/lastres%2Ffizzbuzz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastres%2Ffizzbuzz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastres%2Ffizzbuzz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lastres%2Ffizzbuzz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lastres","download_url":"https://codeload.github.com/lastres/fizzbuzz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149510,"owners_count":20891954,"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":["beam","cowboy","erlang","fizzbuzz","json","json-api","rest-api"],"created_at":"2024-12-17T12:20:26.666Z","updated_at":"2026-05-15T08:04:48.873Z","avatar_url":"https://github.com/lastres.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fizzbuzz [![Build Status](https://travis-ci.org/lastres/fizzbuzz.svg?branch=master)](https://travis-ci.org/lastres/fizzbuzz)\n========\n\nThis is an example implementation of a Fizzbuzz on top of a JSON API.\n\nIt allows fetching individual numbers and also lists of them using pagination.\n\nIt aims to follow the JSON API specification V 1.0 (http://jsonapi.org/)\n\nDependencies\n-\nIt is expected to have Erlang/OTP installed and available in the $PATH. (version 17.4 +).\nThe easiest way to install Erlang/OTP is probably using Kerl: http://github.com/kerl/kerl\n\nWhen building, dependencies will be fetched from Github (see rebar.config file).\n\nHow to build and run\n-\nWith:\n```\n$./rebar3 release\n```\nwill generate a release, that can be started with:\n```\n$ ./_build/default/rel/fizzbuzz/bin/fizzbuzz\n```\nThe server will be listening in port `8080` on `localhost`\n\nUsage\n-\nTo fetch a single nunmber, you can send a `GET` request to the following path\n\n```\n/numbers/NUMBER\n```\nFor example, the following `GET` request:\n\n```\nhttp://localhost:8080/numbers/30\n```\nwill return:\n```\n{\"data\":{\"type\":\"numbers\",\"id\":\"30\",\"attributes\":{\"value\":\"Fizz Buzz\",\"favourite\":\"false\"}}}\n```\nFor pagination, an example would be:\n\n```\nhttp://localhost:8080/numbers?page[number]=1\u0026page[size]=4\n```\nwhich will return:\n\n```\n{\"meta\":{\"total-pages\":25000000000},\"data\":[{\"type\":\"numbers\",\"id\":\"1\",\"attributes\":{\"value\":\"1\",\"favourite\":\"false\"}},{\"type\":\"numbers\",\"id\":\"2\",\"attributes\":{\"value\":\"2\",\"favourite\":\"false\"}},{\"type\":\"numbers\",\"id\":\"3\",\"attributes\":{\"value\":\"Fizz\",\"favourite\":\"false\"}},{\"type\":\"numbers\",\"id\":\"4\",\"attributes\":{\"value\":\"4\",\"favourite\":\"false\"}}]}\n```\nUpdating a resource\n-\nThe application supports updating resources (not creating them) by using PATCH requests. The resources attribute `favourite` is the only one that can be updated. Requests are not expected to include the `value` attribute.\n\nThe following `PATCH` request will mark the number 3 as favourite:\n\n```\nPATCH /numbers/3 HTTP/1.1\nHost: localhost:8080\nContent-Type: application/json\n\n{\"data\":{\"type\":\"numbers\",\"id\":\"3\",\"attributes\":{\"favourite\":\"true\"}}}\n```\nRunning Eunit tests\n-\nFor running the Eunit tests:\n```\n$ ./rebar3 eunit\n```\n\nGenerating coverage report\n-\nAfter running Eunit tests, the following command will generate an HTML coverage report:\n\n```\n$ ./rebar3 cover\n```\n\nPython query script\n-\n\nA very simple Python script to query the Fizzbuzz JSON API is provided.\n\nIt expects the HTTP server to be listening on localhost on port 8080.\n\n```\n$ python fizzbuzz.py --help\nusage: fizzbuzz.py [-h] [-n NUMBER] [-f FAVOURITE] [-u UNFAVOURITE]\n                   [-p PAGE SIZE]\n\n                   Query the Fizbuzz server JSON API.\n\n                   optional arguments:\n                   -h, --help            show this help message and exit\n                   -n NUMBER, --number NUMBER\n                   A resource number\n                   -f FAVOURITE, --favourite FAVOURITE\n                   A number to make favourite\n                   -u UNFAVOURITE, --unfavourite UNFAVOURITE\n                   A number to make no favourite\n                   -p PAGE SIZE, --page PAGE SIZE\n                   Page number and size\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flastres%2Ffizzbuzz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flastres%2Ffizzbuzz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flastres%2Ffizzbuzz/lists"}