Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lobot
lobot / webhook-ts-run-ngrok
Created July 1, 2022 20:22
webhook-ts-run-ngrok
ngrok http 3000
@lobot
lobot / webhook-ts-run-code
Created July 1, 2022 20:21
webhook-ts-run-code
run node .
@lobot
lobot / webhook-ts-index-ts
Created July 1, 2022 20:19
webhook-ts-index-ts
import * as Koa from "koa"
import * as Router from "koa-router"
import * as bodyParser from "koa-bodyparser"
import * as crypto from "crypto"
const app = new Koa()
const router = new Router()
router.post("/webhooks", async(ctx, next) => {
const { rawBody, headers } = ctx.request;
@lobot
lobot / webhook-ts-package-json
Created July 1, 2022 20:17
webhook-ts-package-json
{
"name": "koa-ts-webhook",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
@lobot
lobot / webhook-ts-tsconfig.json
Created July 1, 2022 20:14
webhook-ts-tsconfig.json
{
"version": "2.0.2",
"compilerOptions": {
"outDir": "./dist",
"lib": ["es5", "es6"],
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
@lobot
lobot / webhook-ts-add-type-definitions
Created July 1, 2022 20:11
webhook-ts-add-type-definitions
npm i -D @types/node
@lobot
lobot / webhook-ts-koa-add-dirs
Created July 1, 2022 20:10
webhook-ts-koa-add-dirs
mkdir src dist
@lobot
lobot / webhook-ts-koa-npm-install
Last active July 1, 2022 18:43
webhook-ts-koa-npm-install
npm i -S koa koa-bodyparser koa-router
@lobot
lobot / webhook-ts-setup
Last active July 1, 2022 18:42
webhook-ts-setup
mkdir lob-webhooks
cd lob-webhooks
npm init -y
@lobot
lobot / tracking-event-changes-java
Last active June 1, 2022 18:44
tracking-event-changes-java
package com.company.app;
import java.util.HashMap;
import com.lob.Lob;
import com.lob.model.Address;
import com.lob.model.Postcard;
import com.lob.net.LobResponse;
public class App
{