This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const withPWA = require('next-pwa') | |
| module.exports = withPWA({ | |
| pwa: { | |
| dest: 'public' | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Node.js CI | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: self-hosted | |
| strategy: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| server_name _; | |
| #ONE FOR EACH NEXTJS APP AND SUBDOMAIN | |
| #BIKES - PORT 3001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stripe = require("stripe")("sk_test_SXIuQ6FMks5aBKEOZCvEJn2k"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const subscribeCustomerToPlan = async (customerId, planId) => { | |
| const subscription = await stripe.subscriptions.create({ | |
| customer: customerId, | |
| items: [{plan: planId}], | |
| }); | |
| console.log(subscription); | |
| return subscription; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createCustomer = async () => { | |
| const CUSTOMER_EMAIl = "[email protected]"; | |
| const CUSTOMER_SOURCE = 'tok_mastercard'; | |
| const customer = await stripe.customers.create({ | |
| email: CUSTOMER_EMAIl, | |
| source: CUSTOMER_SOURCE, | |
| }); | |
| console.log(customer); | |
| return customer.id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createPlan = async productId => { | |
| const PLAN_NICKNAME = "Monthly Subscription Plan"; | |
| const PLAN_INTERVAL = "month"; | |
| const CURRENCY = "usd"; | |
| const PLAN_PRICE = 200; | |
| const plan = await stripe.plans.create({ | |
| product: productId, | |
| nickname: PLAN_NICKNAME, | |
| currency: CURRENCY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const createProduct = async () => { | |
| const PRODUCT_NAME = "Monthly Subscription"; | |
| const PRODUCT_TYPE = 'service' | |
| const product = await stripe.products.create({ | |
| name: PRODUCT_NAME, | |
| type: PRODUCT_TYPE, | |
| }); | |
| console.log(product); |