Stripe with Webtask

180 Views Asked by At

I've been working for days on implementing Stripe Checkout into my static site. My static site is generated by React. There is a tutorial for setting up Stripe Checkout using React, however I also need to move the backend function to webtask.

Here is the tutorial. https://www.robinwieruch.de/react-express-stripe-payment/#express-stripe-backend

Any idea on how to port this over to webtask?

1

There are 1 best solutions below

0
On

It should be pretty much the same thing, except that the author in this tutorial is:

  1. Exporting an express server. To use that with webtask you're going to need to explicitly define the programming model with the argument --meta wt-compiler=webtask-tools/express (or you can use webtask-tools).

  2. Splitting the code into multiple files. Luckily wt-cli provides a bundler so it's just a matter of providing the --bundle argument.

So the final command line becomes:

$ wt create index.js --bundle --meta wt-compiler=webtask-tools/express