Skip to content

Commit

Permalink
Added additional project structure to the v1 starter template
Browse files Browse the repository at this point in the history
  • Loading branch information
manterfield committed Jul 23, 2024
1 parent 70cd3d0 commit 4b93fb3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deploy/project_template/v1/flows/hello_world/hello.work.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {
hiphops,
notify,
} from "https://deno.land/x/hiphops@2407-cromulent-fox/mod.ts";

hiphops.run(async ({ data }) => {
// The notify service is built into hiphops.io, no integration required
await notify.sendEmail({
// Recipient addresses need to be added to your account's allow list before you
// can send.
to: ["[email protected]"],
// In this case, data is the raw pull_request event from GitHub (plus the `hops` metadata)
// GitHub's own docs describe the exact structure of events
content: `PR ${data["number"]} was merged!`,
});
});
12 changes: 12 additions & 0 deletions deploy/project_template/v1/flows/hello_world/main.hops
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Hops files use an HCL based DSL (similar to Terraform, Docker Bake, and other tools)
// These files are where you match inbound events to workers
// create schedules, and define custom commands

// Example of triggering a worker on a pullrequest merged event (e.g. from github)
// `pullrequest` is the event, `merged` is the event action.
// `notify_prs` is the name you've given to the flow
on pullrequest_merged notify_prs {
// Will trigger the worker code in `hello.work.js` (or hello.work.ts if you prefer)
worker = "hello"
}

7 changes: 7 additions & 0 deletions deploy/project_template/v1/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ description: Automate all the things!
# Hiphops.io dev portal

Let's build something amazing.

What next?

1. Link your Hiphops.io account with `hops link`, this gives you access to all our services
2. Start the local dev server with `hops up`
3. Create and edit new flows in `flows/FLOW_NAME`
4. Create a your custom UI with markdown in `pages`

0 comments on commit 4b93fb3

Please sign in to comment.