Skip to content

joblisttoday/api

Repository files navigation

endpoints

/ home

A message with the link to this document

/providers

The list of know proviver unique ids, which can be used in the /provider/:id/* endpoints

/providers/:id/:hostname

Where:

  • id is a known provider id from the /providers endpoint
  • hostname is the id of a company, as defined when registered on at the provider's services (often a "slugified version" of the company's name).

This endpoint returns a list of jobs

The know providers, and the job serialization come from https://gitlab.com/joblist/job-board-providers

Examples:

development

Install dependencies (npm, wrangler, hono):

npm install

Run the development server

npx wrangler dev src/index.ts

stripe + ngrok

To receive stripe webhooks, don't forget to set the .dev.vars values, and:

ngrok http 8787 --hostname lively-promoted-lemming.ngrok-free.app

In Stripe add the webhook to https://lively-promoted-lemming.ngrok-free.app/webhooks/stripe

To test the webhooks sending from stripe, need to install and login the stripe cli.

while developing to send a test webhook, use:

stripe trigger payment_intent.succeeded
stripe listen --forward-to https://lively-promoted-lemming.ngrok-free.app/webhooks/stripe

production deployment

should only deploy with CI/CD, for versioning purpose

CI/CD

github + cloudflare

The repo si bound the the main branch on cloudflare which will rebuild on new commits.

gitlab (obsolete)

For example to deploy version 0.0.1 of the api:

  • in package.json bumb version to 0.0.1, then push this as a comit
  • in gitlab UI create a new tag v0.0.1
  • this will trigger the deploy_api job (see file .gitlab-ci.yml), which will publish the api to cloudflare workers (using wrangler)

ENV variables needed in gitlab ci:

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID

note: these variables are defined on the gitlab organisation level and only availabe on protected branches (main) and tags (v*).

Docs:

Manually

npx wrangler publish ./src/index.ts

custom domain

tld: do not add with the cloudflare DNS UI, but the cloudflare worker toml config file, as we're having our site DNS zone on cloudfalre (joblist.today)

docs

Tests

Not yet setup, see here:

About

An API for joblist

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •