{"id":15498742,"url":"https://github.com/jankapunkt/meteor-public-remote-api","last_synced_at":"2026-05-09T10:37:46.478Z","repository":{"id":81102662,"uuid":"77448703","full_name":"jankapunkt/meteor-public-remote-api","owner":"jankapunkt","description":"A handy little class, which helps to expose public collections,  methods and subscriptions into an api JSON file. ","archived":false,"fork":false,"pushed_at":"2017-02-03T15:36:10.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T18:15:19.657Z","etag":null,"topics":["collections","json","meteor","methods","public","publications"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jankapunkt.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":"2016-12-27T10:54:23.000Z","updated_at":"2020-10-24T15:01:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b0d53a8-f205-4d9a-82db-84eb842b3471","html_url":"https://github.com/jankapunkt/meteor-public-remote-api","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/jankapunkt%2Fmeteor-public-remote-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-public-remote-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-public-remote-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jankapunkt%2Fmeteor-public-remote-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jankapunkt","download_url":"https://codeload.github.com/jankapunkt/meteor-public-remote-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068301,"owners_count":20718505,"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":["collections","json","meteor","methods","public","publications"],"created_at":"2024-10-02T08:47:30.060Z","updated_at":"2026-05-09T10:37:46.419Z","avatar_url":"https://github.com/jankapunkt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meteor Public API\n\nHelps you to expose, what is public, while you code.\nJust import the PublicApi class and add definitions directly when you define them.\n\n\n## Usage\n\n\n```javascript\n\nimport { PublicAPI } from \"meteor/jkuester:public-api\";\n\nPublicAPI.setName(\"MY-MICROSERVICE-NAME\");\nPublicAPI.setDescription(\"describe what your application/microservice does...\")\n```\n\nIn your app you declare a method the usual way\n\n```javascript\nconst MY_PUBLIC_METHOD = \"my_public_method\";\nMeteor.methods(MY_PUBLIC_METHOD, function(){ /* some code */ });\n```\n\nAnd then expose it to the api:\n\n```javascript\nPublicAPI.addMethod(MY_PUBLIC_METHOD, \"description of what your method does....\");\n```\n\nSame with collections\n\n```javascript\nconst MY_COLLECTION_NAME = \"myCollectionName\";\nexport MyCollection = new Mongo.Collection(MY_COLLECTION_NAME);\nPublicAPI.addCollection(MY_COLLECTION_NAME, \"a simple collection without schema\");\n```\n\nAnd the same with publlications...\n\n```javascript\nconst PUBCIC_DATA_FROM_MY_COLLECTION = \"publicDataFromMyCollectio\";\nMeteor.publish(PUBCIC_DATA_FROM_MY_COLLECTION, function(){ /* some code */ });\nPublicAPI.addPublication(PUBCIC_DATA_FROM_MY_COLLECTION, \"tells my collection: show me what you got\");\n```\n\nAt the end of all your definitions, you call\n\n```javascript\nPublicAPI.publish(\"api.json\", \"path/to/public/\", \"subpath/in/public\"/*, optionalCallback */);\n```\n\nAnd in your public folder will be something like this:\n\n```javascript\n{\n    \"name\": \"public-api-test-package\",\n    \"desription\": \"some public description\",\n    \"urls\": {\n        \"default\": \"http://localhost:3000\",\n        \"fallback\": \"http://localhost:3333\"\n    },\n    \"methods\": {\n        \"get_all_methods\": \"a method which returns a list of all methods\",\n        \"some_call\": \"some other methods\"\n    },\n    \"publications\": {\n        \"get_all_docs\": \"gets all documents\",\n        \"get_other_docs\": \"gets som other documents\"\n    },\n    \"collections\": {\n        \"logs\": \"a log collection\",\n        \"dogs\": \"a dog collection\"\n    }\n}\n```\n\n## LICENCE\n\n\nMIT, see licence file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjankapunkt%2Fmeteor-public-remote-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjankapunkt%2Fmeteor-public-remote-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjankapunkt%2Fmeteor-public-remote-api/lists"}