Skip to content

Instantly share code, notes, and snippets.

View thomasstep's full-sized avatar
💻

Thomas Step thomasstep

💻
View GitHub Profile
@thomasstep
thomasstep / winston.js
Created July 29, 2019 18:48
Winston configuration
var winston = require('winston');
// In other files use var winston = require('./config/winston') and place this file in the app's config/ directory
var options = {
console: {
level: 'info',
handleExceptions: true,
json: true,
colorize: true,
@thomasstep
thomasstep / force-full-clean.sh
Created April 29, 2021 14:40
Force A Full Clean Docker
#!/bin/bash
docker rm $(docker ps -aq)
docker rmi --force $(docker images -q)
docker system prune --volumes
@thomasstep
thomasstep / stripeWebhookLambdaHandler.js
Created July 2, 2021 15:38
Stripe webhook handler code for AWS API Gateway and Lambda proxy integration
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const {
updateUserSubscription,
deleteUserSubscription,
} = require('./database');
exports.handler = async function (event, context, callback) {
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
try {
const requestId = event?.requestContext?.requestId;