Chris Porter
Chris Porter

Reputation: 143

Stripe with Webtask

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?

Upvotes: 1

Views: 176

Answers (1)

Gunar Gessner
Gunar Gessner

Reputation: 2641

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

Upvotes: 1

Related Questions