Skip to content

Commit 2312f44

Browse files
authored
Merge pull request #301 from DefangLabs/linda-nodejs
Update nodejs samples
2 parents fe843ca + 5c9e6fe commit 2312f44

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,46 @@
44

55
This Node.js application, built with Express.js, is designed to inspect and display detailed information about incoming HTTP requests. It supports all HTTP methods and provides insights into the request path, method, headers, query parameters, and body. Note alongside your project, you should also include a package.json file that includes the relevant metadata such as package dependencies, scripts, project verrsions so that the Dockerfile can install necessary dependencies.
66

7-
## Essential Setup Files
7+
## Prerequisites
88

9-
1. A [Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).
10-
2. A [compose file](https://docs.defang.io/docs/concepts/compose) to define and run multi-container Docker applications (this is how Defang identifies services to be deployed).
9+
1. Download [Defang CLI](https://github.com/DefangLabs/defang)
10+
2. (Optional) If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc) authenticate with your cloud provider account
11+
3. (Optional for local development) [Docker CLI](https://docs.docker.com/engine/install/)
1112

12-
## Prerequisite
13+
## Development
1314

14-
1. Download [Defang CLI](https://github.com/DefangLabs/defang)
15-
2. If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc), make sure you have properly [authenticated your AWS account (optional)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
15+
To run the application locally, you can use the following command:
16+
17+
```bash
18+
docker compose up --build
19+
```
20+
21+
## Configuration
22+
23+
For this sample, you will not need to provide [configuration](https://docs.defang.io/docs/concepts/configuration).
24+
25+
If you wish to provide configuration, see below for an example of setting a configuration for a value named `API_KEY`.
26+
27+
```bash
28+
defang config set API_KEY
29+
```
30+
31+
## Deployment
32+
33+
> [!NOTE]
34+
> Download [Defang CLI](https://github.com/DefangLabs/defang)
35+
36+
### Defang Playground
37+
38+
Deploy your application to the Defang Playground by opening up your terminal and typing:
39+
```bash
40+
defang compose up
41+
```
42+
43+
### BYOC (AWS)
1644

17-
## A Step-by-Step Guide
45+
If you want to deploy to your own cloud account, you can [use Defang BYOC](https://docs.defang.io/docs/tutorials/deploy-to-your-cloud).
1846

19-
1. Open the terminal and type `defang login`
20-
2. Type `defang compose up` in the CLI
21-
3. Your app should be up and running with Defang in minutes!
2247

2348
---
2449

0 commit comments

Comments
 (0)