@@ -155,21 +155,21 @@ if (import.meta.main) {
155
155
```
156
156
157
157
You can run the API server with
158
- ` deno run --allow-env --allow-net server/main.ts ` . We'll create a task to run
159
- this command in the background and update the dev task to run both the React app
160
- and the API server.
158
+ ` deno run --allow-env --allow-net --allow-read server/main.ts ` . We'll create a
159
+ task to run this command in the background and update the dev task to run both
160
+ the React app and the API server.
161
161
162
- In your ` package.json ` file, update the ` scripts ` field to include the
163
- following:
162
+ In your ` deno.json ` file, update the ` tasks ` field to include the following:
164
163
165
164
``` diff title="deno.json"
166
165
{
167
166
"tasks": {
168
- + "dev": "deno run -A --node-modules-dir=auto npm:vite & deno run server:start",
169
- "build": "deno run -A --node-modules-dir=auto npm:vite build",
167
+ + "dev": "deno run -A npm:vite & deno run server:start",
168
+ "build": "deno run -A npm:vite build",
170
169
"server:start": "deno run -A --node-modules-dir --watch ./server/main.ts",
171
170
"serve": "deno run build && deno run server:start"
172
- }
171
+ },
172
+ + "nodeModulesDir": "auto",
173
173
```
174
174
175
175
If you run ` deno run dev ` now and visit ` localhost:8000/api/dinosaurs ` , in your
@@ -359,7 +359,7 @@ To run the app use the task you set up earlier
359
359
deno run dev
360
360
```
361
361
362
- Navigate to the local Vite server in your browser (` localhost:5173 ` ) and you
362
+ Navigate to the local Vite server in your browser (` localhost:3000 ` ) and you
363
363
should see the list of dinosaurs displayed which you can click through to find
364
364
out about each one.
365
365
0 commit comments