Skip to content

[TRI-768] The CLI init command should generate a jobs/index file and jobs should be imported there. #224

Description

@matt-aitken

When npx @trigger.dev/cli@latest init is run it generates the Trigger API route, and an example job.

In the Trigger API route (app/api/trigger.route.ts for app router and pages/api/trigger.ts for pages router) it imports an individual example job:

import { createAppRoute } from "@trigger.dev/nextjs";
import { client } from "@/trigger";

// Replace this with your own jobs
import "@/jobs/examples";

//this route is used to send and receive data with Trigger.dev
export const { POST, dynamic } = createAppRoute(client);

Let's change it so we have an index file inside the jobs folder and just that is imported here.

In that index file we would import the examples file.

From SyncLinear.com | TRI-768

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions