{"id":20670478,"url":"https://github.com/caicloud/nirvana-practice","last_synced_at":"2025-04-19T18:23:49.656Z","repository":{"id":54154210,"uuid":"197503569","full_name":"caicloud/nirvana-practice","owner":"caicloud","description":"Get familiar with Nirvana in a practical way.","archived":false,"fork":false,"pushed_at":"2020-09-28T05:54:25.000Z","size":263,"stargazers_count":4,"open_issues_count":0,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T11:34:40.612Z","etag":null,"topics":["engineering","framework","golang","nirvana"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/caicloud.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":"2019-07-18T03:20:52.000Z","updated_at":"2024-01-29T14:42:50.000Z","dependencies_parsed_at":"2022-08-13T07:50:17.591Z","dependency_job_id":null,"html_url":"https://github.com/caicloud/nirvana-practice","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/caicloud%2Fnirvana-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caicloud%2Fnirvana-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caicloud%2Fnirvana-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caicloud%2Fnirvana-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caicloud","download_url":"https://codeload.github.com/caicloud/nirvana-practice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249762260,"owners_count":21321901,"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":["engineering","framework","golang","nirvana"],"created_at":"2024-11-16T20:20:46.155Z","updated_at":"2025-04-19T18:23:49.631Z","avatar_url":"https://github.com/caicloud.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nirvana Practice Project\n\n\u003cimg align=\"right\" width=\"225px\" src=\"https://user-images.githubusercontent.com/2191361/35839723-e9e5cdfa-0b2c-11e8-853a-8d3870f9e7ac.png\"\u003e\n\nAs a HTTP server framework, [Nirvana](https://github.com/caicloud/nirvana) is robust but can also be quite complicated. This project let you practice writing Restful APIs with Nirvana.\n\n## Prerequisites\n\n - [Golang](https://golang.org/dl/) - the Go language\n - [dep](https://github.com/golang/dep) - the Go dependency management tool used by Nirvana\n \nThat is. You'll use dep to install the required Go packages.\n\n## Getting Started\n\nThe project is already runnable as it is. Use dep to install the dependencies and the Makefile to build it.\n\n```\n$ dep ensure -v\n\n$ VERSION=v0.1.0 make build\n```\n\nCheck out the help message and version information.\n\n```\n $ bin/practice-server -h\nUsage of bin/practice-server:\n  -p, --port uint16   the HTTP port used by the server (default 8080)\n  -v, --version       show version info\npflag: help requested\n\n$ bin/nirvana-practice -v\nnirvana-practice, version v0.1.0 (branch: master), revision: ab9132625bd5e2b9c8d3b2ff23c423cc9c02e9ec)\n```\n\nNow run the server and try the APIs.\n\n```\n$ bin/practice-server -p 8080\n\n$ curl localhost:8080/api/v1alpha1/products\n{\"reason\":\"practice:NotImplemented\",\"message\":\"requested feature is not implemented\"}\n\n$ curl localhost:8080/api/v1alpha1/unknown\n{\"reason\":\"Nirvana:Router:RouterNotFound\",\"message\":\"can't find router\"}\n```\n\n## Do It Yourself\n\nThe product API is already defined in `pkg/apis/v1alpha1/products.go` for you, alone with the incomplete `GET` and `LIST` API descriptors and handlers. Try to finish the `GET` and `LIST` APIs, and write `POST`, `LIST`, `PUT`, and `DELETE` from scratch. \n\nUse GitHub issue to ask questions and, once finished, submit a PR to this repo to show off your result. \n\n## Containerize Your App\n\nOnce your code is finished and tested, you might want to containerize your app so that you can deploy it practically. The Dockerfile is created for you under the `/build` directory. Try to finish it run `make container` to build the container images. \n\nCheck out [the official Docker Getting-Started guide](https://docs.docker.com/get-started/) if you are not already familiar with Docker and containers. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaicloud%2Fnirvana-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaicloud%2Fnirvana-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaicloud%2Fnirvana-practice/lists"}