Skip to content

Commit dde51d6

Browse files
committed
Astro docs improvements
1 parent dbd0942 commit dde51d6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/_snippets/manual-setup-astro.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ To set up the Trigger Client for your project, follow these steps:
9090

9191
By following these steps, you'll configure the Trigger Client to work with your project, regardless of whether you have a separate **src** directory and whether you're using TypeScript or JavaScript files.
9292

93-
## update the astro.config file to enable ssr
93+
## Update the astro.config file to enable ssr
9494

95-
- You need to enable ssr to use API endpoints that would be in the `pages/api` folder
95+
- You need to enable ssr to use API endpoints (which are required by Trigger.dev).
9696

9797
```typescript astro.config.mjs
9898
import { defineConfig } from "astro/config";
@@ -109,12 +109,13 @@ To establish an API route for interacting with Trigger.dev, follow these steps b
109109
1. Create a new file named `trigger.(ts/js)` within the `pages/api/` directory.
110110
2. Add the following code to `trigger.(ts/js)`:
111111

112-
```typescript api/trigger.ts/js
112+
```typescript src/pages/api/trigger.(ts/js)
113113
import { createAstroRoute } from "@trigger.dev/astro";
114-
import { client } from "@/trigger";
114+
//you may need to update this path to point at your trigger.ts file
115+
import { client } from "../../trigger";
115116

116-
//import your jobs
117-
import "@/jobs";
117+
//import your jobs, this could be different depending on your project structure
118+
import "../../jobs";
118119

119120
export const { POST } = createAstroRoute(client);
120121
```
@@ -126,7 +127,7 @@ export const { POST } = createAstroRoute(client);
126127

127128
<CodeGroup>
128129

129-
```typescript example.(ts/js)
130+
```typescript src/jobs/example.(ts/js)
130131
import { eventTrigger } from "@trigger.dev/sdk";
131132
import { client } from "@/trigger";
132133

@@ -148,10 +149,9 @@ client.defineJob({
148149
});
149150
```
150151

151-
```typescript index.ts/index.(ts/js)
152-
// import all your job files here
153-
154-
export * from "./examples";
152+
```typescript src/jobs/index.(ts/js)
153+
// export all your job files here
154+
export * from "./example";
155155
```
156156

157157
</CodeGroup>

0 commit comments

Comments
 (0)