-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #718 from humanmade/backport-710-to-v19-branch
Backport #710 to v19 branch
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Node.js | ||
|
||
Altis supports running Node.js applications alongside WordPress, utilizing WordPress as a headless API. | ||
|
||
## Enabling Node.js in Local Server | ||
|
||
Node.js can be enabled in Local Server by adding `extra.altis.modules.local-server.nodejs` in the project's `composer.json` | ||
|
||
```json | ||
{ | ||
"extra":{ | ||
"altis":{ | ||
"modules":{ | ||
"local-server":{ | ||
"nodejs":{ | ||
"path":"../altis-nodejs-skeleton" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
`path` is relative to the directory where `composer.json` lives. | ||
|
||
## Setting Node.js Version | ||
Similar to configuring the Altis infrastructure, the Local Server determines the Node.js version to use based on the `engines.node` value found in the `package.json` at the specified `path`. | ||
|
||
## Running Development Server | ||
Once configured, the Local Server executes `npm run dev` inside the Node.js container at the specified path. This command watches for changes and recompiles necessary files. | ||
|
||
## Accessing the Application | ||
This setup makes the application accessible at `https://nodejs-{project-name}.altis.dev`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters