Skip to content

Instantly share code, notes, and snippets.

View skolhustick's full-sized avatar

eshwarenm skolhustick

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
</head>
<body>
<!-- Add two inputs for "phoneNumber" and "code" -->
var createError = require("http-errors");
var express = require("express");
var path = require("path");
var cookieParser = require("cookie-parser");
var logger = require("morgan");
var indexRouter = require("./routes/index");
var usersRouter = require("./routes/users");
const hbs = require("express-handlebars");
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express', someVariable: 'example' });
});
module.exports = router;
<h1>{{title}}</h1>
<p>Welcome to {{title}}</p>
{{#is someVariable 'example'}}
THIS WILL BE RENDERED
{{/is}}
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);
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,
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;
const subscribeCustomerToPlan = async (customerId, planId) => {
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{plan: planId}],
});
console.log(subscription);
return subscription;
}
const stripe = require("stripe")("sk_test_SXIuQ6FMks5aBKEOZCvEJn2k");
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
#ONE FOR EACH NEXTJS APP AND SUBDOMAIN
#BIKES - PORT 3001