Skip to content

Instantly share code, notes, and snippets.

Avatar

Lob Developers lobot

View GitHub Profile
View 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 Jul 1, 2022
webhook-ts-package-json
View 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 Jul 1, 2022
webhook-ts-tsconfig.json
View 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-koa-npm-install
Last active Jul 1, 2022
webhook-ts-koa-npm-install
View webhook-ts-koa-npm-install
npm i -S koa koa-bodyparser koa-router
@lobot
lobot / webhook-ts-setup
Last active Jul 1, 2022
webhook-ts-setup
View webhook-ts-setup
mkdir lob-webhooks
cd lob-webhooks
npm init -y
@lobot
lobot / tracking-event-changes-java
Last active Jun 1, 2022
tracking-event-changes-java
View 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
{