Skip to content

Sweep(slow): [TRI-768] The CLI init command should generate a jobs/index file and jobs should be imported there. #1

@wwzeng1

Description

@wwzeng1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    sweepAssigns Sweep to an issue or pull request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions