Skip to content

DefangSamples/sample-angular-express-template

Repository files navigation

Angular & Node.js

1-click-deploy

This sample demonstrates how to deploy a full-stack Angular and Node.js application with Defang. It uses Socket.IO for real-time communication. The Docker setup ensures the app can be easily built and deployed.

Prerequisites

  1. Download Defang CLI
  2. (Optional) If you are using Defang BYOC authenticate with your cloud provider account
  3. (Optional for local development) Docker CLI
  4. Install Node.js
  5. Install Angular CLI

Development

For development, we use two local containers, one for the frontend Angular service and one for the backend service in Express. It also uses Caddy as a web server for serving static files.

To run the application locally, you can use the following command:

docker compose -f compose.dev.yaml up --build

Configuration

For this sample, you will not need to provide configuration.

If you wish to provide configuration, see below for an example of setting a configuration for a value named API_KEY.

defang config set API_KEY

Deployment

Note

Download Defang CLI

Defang Playground

Deploy your application to the Defang Playground by opening up your terminal and typing:

defang compose up

BYOC (AWS)

If you want to deploy to your own cloud account, you can use Defang BYOC:

  1. Authenticate your AWS account, and check that you have properly set your environment variables like AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY.
  2. Run in a terminal that has access to your AWS environment variables:
    defang --provider=aws compose up

Title: Angular & Node.js

Short Description: A full-stack application using Angular for the frontend and Node.js with Socket.IO for the backend, containerized with Docker.

Tags: Angular, Node.js, Socket.IO, TypeScript, JavaScript

Languages: nodejs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published