Skip to content

Commit

Permalink
cleans up the code block references
Browse files Browse the repository at this point in the history
  • Loading branch information
superterran committed Aug 10, 2024
1 parent 0d98a06 commit 506fa3b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ We can optionally install any global node dependancies required to make the solu
In this example, we're adding the global dependancies needed to build a remix project:

```yaml
$ cat .magento.app.yaml

name: mypwa

dependencies:
nodejs:
node-sass: "^9.0.0"
Expand All @@ -28,42 +32,65 @@ dependencies:
Modify the build hook to align with the steps needed to build your applicaiton.
```yaml
$ cat .magento.app.yaml

name: mypwa
...
hooks:
build: |
set -e
npm install
npm run build
...
```

### starting the app

Finally, when the instance comes up this will start the server command. If this command exits for any reason, it will be immedately restarted:

```yaml
$ cat .magento.app.yaml

name: mypwa
...
web:
commands:
start: |
npm run start:cloud
...
```

### mounts

While this example does not use mounts, one can easily introduce them to allow for read-write operations within the runtime stack.

```yaml

$ cat .magento.app.yaml

name: mypwa
...
mounts:
"build": "shared:build/"
"public/build": "shared:public-build"
...
```

### Server listening on port 8888

The base configuration will listen for anything to bind to port 8888 and will try and serve that out to the world. Make sure that your web server is binded to this port. This can be accomplished several ways, but in our example we're using a `npm run` command to set a `PORT` environment variable that is interpreted by our server.

```yaml
scripts:
```json
$ cat package.json
{
"name": "commerce-cloud-example",
...
"scripts": {
"start:cloud": "PORT=8888 node server.js"
...
}
```

## Single App Mode
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "adobe-commerce-cloud-hosting-examples-pwa",
"name": "commerce-cloud-example",
"version": "1.0.0",
"description": "An example express app to illustrate how to host in Adobe Commerce Cloud",
"main": "server.js",
Expand Down

0 comments on commit 506fa3b

Please sign in to comment.