More work on deployment
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Printful } from "./printful.ts"
|
||||
import { ProductRecords } from "./database/product-records.ts"
|
||||
import { ProductRecords } from "./data/product-records.ts"
|
||||
import { Webflow } from "./webflow.ts";
|
||||
|
||||
const productRecords = new ProductRecords();
|
||||
@@ -7,13 +7,14 @@ const productRecords = new ProductRecords();
|
||||
const server = Bun.serve({
|
||||
routes: {
|
||||
"/test": {
|
||||
async GET(req){
|
||||
async GET(req) {
|
||||
return Response.json("Hello world");
|
||||
}
|
||||
},
|
||||
"/webhook/printful": {
|
||||
async POST(req) {
|
||||
const payload: Printful.Webhook.EventPayload = await req.json()
|
||||
console.log(JSON.stringify(payload));
|
||||
switch (payload.type) {
|
||||
case Printful.Webhook.Event.ProductUpdated:
|
||||
const printfulProduct = await Printful.getSyncProduct(payload.data.sync_product.id)
|
||||
|
||||
Reference in New Issue
Block a user