{"id":16227462,"url":"https://github.com/simonaco/pbp-serverless","last_synced_at":"2025-03-19T13:31:05.857Z","repository":{"id":145737122,"uuid":"120356792","full_name":"simonaco/pbp-serverless","owner":"simonaco","description":"Azure Functions for a serverless API in Nodejs","archived":false,"fork":false,"pushed_at":"2018-04-10T10:59:38.000Z","size":14,"stargazers_count":23,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-14T19:31:05.732Z","etag":null,"topics":["azure","azure-functions","nodejs","serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/simonaco.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-05T20:20:14.000Z","updated_at":"2024-07-12T10:23:57.000Z","dependencies_parsed_at":"2023-03-28T00:21:27.253Z","dependency_job_id":null,"html_url":"https://github.com/simonaco/pbp-serverless","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fpbp-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fpbp-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fpbp-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonaco%2Fpbp-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonaco","download_url":"https://codeload.github.com/simonaco/pbp-serverless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989730,"owners_count":20379648,"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":["azure","azure-functions","nodejs","serverless"],"created_at":"2024-10-10T12:52:51.253Z","updated_at":"2025-03-19T13:31:05.850Z","avatar_url":"https://github.com/simonaco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CRUD Serverless API\n\nThis project represents a fully serverless implementation for a CRUD (Create, Retrieve, Update, Delete) API implemented with [Azure Functions](https://aka.ms/azure-functions) and [Azure Cosmos DB](https://aka.ms/azure-cosmosdb).\n\nFor the purpose of this demo we are going to use an Angular application built by [John Papa](https://twitter.com/John_Papa). The code for this application is available on Github at [Angular Cosmos DB](https://github.com/johnpapa/angular-cosmosdb).\n\nYou can watch John Papa and I talk about this project in this [Pluralsight course](https://aka.ms/pbp). \n\n## Requirements\n\n1.  Install the [Azure Functions for Visual Studio Code](https://aka.ms/vscode-azure-functions) extension\n\n## Getting Started\n\n1.  Clone this repository\n\n    ```bash\n    git clone https://github.com/simonaco/pbp-serverless.git\n    cd pbp-serverless\n    ```\n\n1.  Install the npm packages\n\n    ```bash\n    npm i\n    ```\n\n1.  Configure Cosmos DB server settings\n\n    Go to `local.settings.json` in the project root and update it with your Cosmos DB settings. If the file doesn't exist, make sure to create it. Replace the database name, password and port with your specific configuration.\n\n    ```javascript\n    // local.settings.json\n    {\n    \"IsEncrypted\": false,\n        \"Values\": {\n            \"AzureWebJobsStorage\": \"\",\n            \"CosmosDBURL\": \"mongodb://\u003cyour-HOST-goes-here\u003e:\u003cyour-PORT-goes-here\u003e/?ssl=true\",\n            \"CosmosDBUser\": \"\u003cyour-USERNAME-goes-here\u003e\",\n            \"CosmosDBPass\": \"\u003cyour-PASSWORD-goes-here\u003e\",\n            \"CosmosDB\": \"\u003cyour-cosmos-db-name-goes-here\u003e\"\n        },\n        \"Host\": {\n            \"LocalHttpPort\": 7071,\n            \"CORS\": \"*\"\n        }\n    }\n    ```\n\n1.  Go to [Angular Cosmos DB](https://github.com/johnpapa/angular-cosmosdb) and follow steps to get started and run the app there\n\n## Running the application locally\n\n1.  Open the application in VS Code and run application\n\n    ![Run Azure Functions locally in VS Code](https://i.imgur.com/GfjuEKD.gif)\n\n1.  Assuming you went through the steps of installing and running your Angular application locally now open the app in VS Code and go to `hero.service.ts` and configure your endpoint to be the newly created functions:\n\n    ```javascript\n    const api = 'http://localhost:7071/api';\n    ```\n\n## Publish your API to the cloud\n\n1.  In VS Code go to Azure Functions extension and follow steps in this [video](https://youtu.be/8GAO3obgEzc)\n\n1.  In the Azure portal go to your newly published function app and copy URL\n\n    ![Get Function URL from the Azure portal](https://i.imgur.com/LCl1kNN.gif)\n\n1.  In your Angular app go to `hero.service.ts` and configure your endpoint to point to the newly deployed function:\n\n    ```javascript\n    const api = 'https://sicotin-serverless.azurewebsites.net/api';\n    ```\n\n---\n\nIf you're looking for more use cases on what you can build with serverless make sure to checkout [An open source set of common use cases for Azure Functions](https://aka.ms/serverless-demos)\n\n## Problems or Suggestions\n\n[Open an issue here](https://github.com/simonaco/pbp-serverless/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonaco%2Fpbp-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonaco%2Fpbp-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonaco%2Fpbp-serverless/lists"}