Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A sample Express.js app using a MongoDB database to show how to host Node.js app in Azure App service using Azure Cosmos DB

License

NotificationsYou must be signed in to change notification settings

Azure-Samples/msdocs-nodejs-mongodb-azure-sample-app

Repository files navigation

page_typelanguagesproductsurlFragmentnamedescription
sample
azdeveloper
javascript
bicep
azure
azure-app-service
azure-cosmos-db
azure-virtual-network
azure-key-vault
azure-cache-redis
msdocs-nodejs-mongodb-azure-sample-app
Deploy a Express.js web app with MongoDB in Azure
This is a CRUD web app that uses Express.js and Azure Cosmos DB.

This is a CRUD (create-read-update-delete) web app that uses Express.js and Azure Cosmos DB. The Node.js app is hosted in a fully managed Azure App Service. This app is designed to be be run locally Linux Node.js container in Azure App Service. You can either deploy this project by following the tutorialTutorial: Deploy a Node.js + MongoDB web app to Azure or by using theAzure Developer CLI (azd) according to the instructions below.

Run the sample

This project has adev container configuration, which makes it easier to develop apps locally, deploy them to Azure, and monitor them. The easiest way to run this sample application is inside a GitHub codespace. Follow these steps:

  1. Fork this repository to your account. For instructions, seeFork a repo.

  2. From the repository root of your fork, selectCode >Codespaces >+.

  3. In the codespace terminal, run the following command:

    npm install&& npm start
  4. When you see the messageYour application running on port 3000 is available., clickOpen in Browser.

Quick deploy

This project is designed to work well with theAzure Developer CLI, which makes it easier to develop apps locally, deploy them to Azure, and monitor them.

🎥 Watch a deployment of the code inthis screencast.

Steps for deployment:

  1. Sign up for afree Azure account

  2. Install theAzure Dev CLI. (If you opened this repository in a Dev Container, it's already installed for you.)

  3. Log in to Azure.

    azd auth login
  4. Provision and deploy all the resources:

    azd up

    It will prompt you to create a deployment environment name, pick a subscription, and provide a location (likewesteurope). Then it will provision the resources in your account and deploy the latest code. If you get an error with deployment, changing the location (like to "centralus") can help, as there may be availability constraints for some of the resources.

  5. Whenazd has finished deploying, you'll see an endpoint URI in the command output. Visit that URI, and you should see the CRUD app! 🎉 If you see an error, open the Azure Portal from the URL in the command output, navigate to the App Service, select Logstream, and check the logs for any errors.

  6. When you've made any changes to the app code, you can just run:

    azd deploy

Getting help

If you're working with this project and running into issues, please post inIssues.

About

A sample Express.js app using a MongoDB database to show how to host Node.js app in Azure App service using Azure Cosmos DB

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp