{"id":14384575,"url":"https://github.com/testdrivenio/openfass-node-restful-api","last_synced_at":"2025-08-23T17:32:51.217Z","repository":{"id":92114212,"uuid":"119117113","full_name":"testdrivenio/openfass-node-restful-api","owner":"testdrivenio","description":"Simple example of an OpenFaaS RESTful API","archived":false,"fork":false,"pushed_at":"2018-04-27T12:54:10.000Z","size":14,"stargazers_count":34,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-29T18:35:05.279Z","etag":null,"topics":["docker","docker-swarm","faas","javascript","kubernetes","openfaas","serverless"],"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/testdrivenio.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}},"created_at":"2018-01-27T00:14:04.000Z","updated_at":"2023-09-08T17:35:48.000Z","dependencies_parsed_at":"2024-01-14T20:16:59.531Z","dependency_job_id":"72750659-e338-4a34-9539-a538ce70f518","html_url":"https://github.com/testdrivenio/openfass-node-restful-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/testdrivenio%2Fopenfass-node-restful-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdrivenio%2Fopenfass-node-restful-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdrivenio%2Fopenfass-node-restful-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testdrivenio%2Fopenfass-node-restful-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testdrivenio","download_url":"https://codeload.github.com/testdrivenio/openfass-node-restful-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716564,"owners_count":18269790,"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":["docker","docker-swarm","faas","javascript","kubernetes","openfaas","serverless"],"created_at":"2024-08-28T18:01:29.022Z","updated_at":"2024-12-21T12:30:43.661Z","avatar_url":"https://github.com/testdrivenio.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# OpenFaaS RESTful API w/ Node and Postgres\n\nSimple example of an [OpenFaaS](https://www.openfaas.com/) RESTful API.\n\n## Getting Started\n\nBuild the Docker images for the functions:\n\n```sh\n$ sh build.sh\n```\n\nInitialize Swarm mode:\n\n```sh\n$ docker swarm init\n```\n\nDeploy:\n\n```sh\n$ docker stack deploy func --compose-file docker-compose.yml --prune\n```\n\nCreate database and `movie` table:\n\n```sh\n$ PG_CONTAINER_ID=$(docker ps --filter name=movies-db --format \"{{.ID}}\")\n$ docker exec -ti $PG_CONTAINER_ID psql -U postgres -W\n# CREATE DATABASE movies;\n# \\c movies\n# CREATE TABLE movie(id SERIAL, name varchar);\n# \\q\n```\n\nTest:\n\n```sh\n$ curl -X POST http://localhost:8080/function/func_api-create -d \\\n  '{\"name\":\"NeverEnding Story\"}'\n\n$ curl http://localhost:8080/function/func_api-read\n\n$ curl -X POST http://localhost:8080/function/func_api-update -d \\\n  '{\"name\":\"NeverEnding Story 2\", \"id\": \"1\"}'\n\n$ curl -X POST http://localhost:8080/function/func_api-delete -d \\\n  '{\"id\":\"1\"}'\n```\n\n## Deploy to Digital Ocean \n\n[deploy-swarm.md](deploy-swarm.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestdrivenio%2Fopenfass-node-restful-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestdrivenio%2Fopenfass-node-restful-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestdrivenio%2Fopenfass-node-restful-api/lists"}