Skip to content

Commit 08ef598

Browse files
committed
update readme
1 parent 2c1281b commit 08ef598

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

examples/angular/template-hierarchy-data-fetching/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ In this example we show how to implement the WordPress Template Hierarchy in Ang
1616
1717
## Trouble Shooting
1818
1. I get "Page Not Found. Sorry, the page you are looking for does not exist. Please check the URL." when opening the Angular app and trying to navigate through it.
19-
- Run `npm run backend:start` and verify that http://localhost:3000/api/templates returns correct data
19+
- Run `npm run backend:start` and verify that http://localhost:3000/api/templates returns correct data.
20+
- Verify if you have added `/backend/.env` file with correct `FRONTEND_URL`.
21+
- check for any errors in the console
22+
1. In some cases, you might have to install @angluar/cli globally. In /example-app/ run `npm install -g @angular/cli@latest`
2023
2. To reset the WP server and re-run setup you can run `npm run example:prune` and confirm "Yes" at any prompts.

examples/angular/template-hierarchy-data-fetching/backend/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Used purely to fetch dynamically the available templates in `/example-app/src/ap
44

55
## Getting Started
66

7-
1. Run `npm run dev` to start backend service for fetching templates at `http://localhost:3000/api/templates`. It fetches the templates located in `/example-app/src/app/components/wp-templates`.
7+
1. Add `.env` file with `FRONTEND_URL=http://localhost:4200` or the desired URL for your Angular front application.
8+
2. Run `npm run dev` to start backend service for fetching templates at `http://localhost:3000/api/templates`. It fetches the templates located in `/example-app/src/app/components/wp-templates`.

examples/angular/template-hierarchy-data-fetching/backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "backend",
33
"version": "1.0.0",
44
"main": "server.js",
5+
"type": "module",
56
"scripts": {
67
"start": "node server.js",
78
"dev": "nodemon server.js"

0 commit comments

Comments
 (0)