{"id":30883241,"url":"https://github.com/globocom/functions","last_synced_at":"2025-10-12T05:08:58.231Z","repository":{"id":35019337,"uuid":"69399580","full_name":"globocom/functions","owner":"globocom","description":"DEPRECATED: An Open Source Serverless Platform","archived":false,"fork":false,"pushed_at":"2025-03-28T14:07:10.000Z","size":907,"stargazers_count":49,"open_issues_count":10,"forks_count":20,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-09-16T09:58:03.446Z","etag":null,"topics":["lambda","lambda-functions","nodejs","pipeline","serverless"],"latest_commit_sha":null,"homepage":"","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/globocom.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-09-27T21:19:57.000Z","updated_at":"2025-09-07T02:57:37.000Z","dependencies_parsed_at":"2024-02-07T22:25:37.780Z","dependency_job_id":"476bd31b-81d1-4c3c-bfef-9395da4ace38","html_url":"https://github.com/globocom/functions","commit_stats":null,"previous_names":["backstage/functions"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/functions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ffunctions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ffunctions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ffunctions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ffunctions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/functions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2Ffunctions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010341,"owners_count":26084738,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":["lambda","lambda-functions","nodejs","pipeline","serverless"],"created_at":"2025-09-08T09:43:42.664Z","updated_at":"2025-10-12T05:08:58.225Z","avatar_url":"https://github.com/globocom.png","language":"JavaScript","readme":" ![Tests](https://github.com/globocom/functions/actions/workflows/tests.yml/badge.svg) ![No Maintenance Intended](https://img.shields.io/maintenance/no/2024.svg)\n# DEPRECATED! Backstage Functions\nBackstage Functions is an Open Source [Serverless](http://martinfowler.com/articles/serverless.html) Platform able to store and execute code.\n\n`NOTE: This is no longer maintained, please consider using other serverless engine projects like fn or OpenFaaS instead.`\n\n## Benefits\n- Your code will be executed in an isolated environment\n- You don't have to worry about infrastructure\n- Functions can be called at any time by any project\n\n## FAQ\n- **Which languages are supported?**\nCurrently, only Javascript.\n\n- **Is it based on events?**\nNot yet.\n\n- **How the code execution happens in an isolated way?**\nIt uses the [Backstage Functions Sandbox](https://github.com/backstage/functions-sandbox).\n\n## Running locally without Docker\n### Requirements\n- Redis 3.0+\n- NodeJS 8.13.0\n\n### Download the project\n```bash\ngit clone https://github.com/backstage/functions.git\n```\n\n### Setup\n```bash\nmake setup\n```\n\n### Run\n```bash\nmake run\n```\n\n## Configuration\n\nTo format your log in `json`, please run:\n\n```sh\nexport LOG_APP_FORMAT=json\n```\n\n## Running locally via Docker\n### Requirements\n- Docker 1.12+\n- Docker compose 1.8+\n\n### Download docker-compose.yml\n```bash\nmkdir functions\ncd functions\ncurl 'https://raw.githubusercontent.com/backstage/functions/master/docker-compose.yml' \u003e docker-compose.yml\n```\n\n### Run\n```bash\ndocker-compose up\n```\n\n## How to use\n### Function Structure\nYour function will have a file, which you define any name you want, and it has to have a function called `main`, with two parameters: `req` and `res`. Req represents the `Request` and Res represents the `Response`.\nAt the end of your code, you'll have to use the `send` method.\n\n#### Example of a function\n```javascript\nfunction main(req, res) {\n  const name = (req.body \u0026\u0026 req.body.name) || \"World\"\n  res.send({ say: `Hello ${name}!` })\n}\n```\n### Setting a function\n\nTo set your function, you can make a `PUT` request to `/functions/:namespace/:name`:\n```bash\ncurl -i -X PUT http://localhost:8100/functions/example/hello-world \\\n    -H 'content-type: application/json' \\\n    -d '{\"code\":\"function main(req, res) {\\n  const name = (req.body \u0026\u0026 req.body.name) || \\\"World\\\"\\n  res.send({ say: `Hello ${name}! Nice meeting you...` })\\n}\\n\"}'\n```\n\n*Ps: if it doesn't exists, it will be created*\n\n### Deleting a function\nTo delete your function, you can make a `DELETE` request to `/functions/:namespace/:name`:\n```bash\ncurl -i -X DELETE http://localhost:8100/functions/example/hello-world \\\n    -H 'content-type: application/json'\n```\n\n### Executing a function\nTo execute a function, you can make a `PUT` request to `/functions/:namespace/:name/run`:\n```bash\ncurl -i -X PUT http://localhost:8100/functions/example/hello-world/run \\\n    -H 'content-type: application/json'\n```\n\nThe result will be something like:\n```bash\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\nContent-Length: 22\nETag: W/\"16-soBGetwJPBLt8CqWpBQu+A\"\nDate: Tue, 11 Oct 2016 16:51:04 GMT\nConnection: keep-alive\n\n{\"say\":\"Hello World!\"}\n```\n\nIf one needs to pass an object in the request, the payload is executed:\n```bash\ncurl -i -X PUT http://localhost:8100/functions/example/hello-world/run \\\n    -H 'content-type: application/json' \\\n    -d '{\"name\": \"Pedro\"}'\n```\n\nThe result will be something like:\n```bash\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\nContent-Length: 22\nETag: W/\"16-Ino2/umXaZ3xVEhoqyS8aA\"\nDate: Tue, 11 Oct 2016 17:13:11 GMT\nConnection: keep-alive\n\n{\"say\":\"Hello Pedro!\"}\n```\n\n### Executing functions in a pipeline\n\nTo execute many functions in a pipeline, you can make a `PUT` request to `/functions/pipeline`:\n```javascript\n// Function0\nfunction main(req, res) {\\\n  res.send({x: req.body.x * 10});\n\n}\n\n// Function1\nfunction main(req, res) {\n  res.send({x: req.body.x * 20});\n}\n```\n\n```\ncurl -g -i -X PUT 'http://localhost:8100/functions/pipeline?steps[0]=namespace/function0\u0026steps[1]=namespace/function1' \\\n    -H 'content-type: application/json'\n    -d '{\"x\": 1}'\n```\n\nConsidering the curl above, the pipeline result would be like this:\n\n```bash\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\nContent-Length: 22\nETag: W/\"16-Ino2/umXaZ3xVEhoqyS8aA\"\nDate: Tue, 11 Oct 2016 17:13:11 GMT\nConnection: keep-alive\n\n{\"x\": 200}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Ffunctions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Ffunctions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Ffunctions/lists"}