This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto" | |
"crypto/hmac" | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha256" | |
// "crypto/x509" | |
"encoding/base64" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import os | |
import json | |
WHITEBOARDING_TABLE = os.environ['WHITEBOARDING_TABLE'] | |
db_client = boto3.resource('dynamodb') | |
table = db_client.Table(WHITEBOARDING_TABLE) | |
def handler(event, context): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: whiteboarding | |
package: | |
individually: true | |
provider: | |
name: aws | |
runtime: python3.8 | |
region: us-west-1 | |
stage: ${opt:stage, "dev"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frameworkVersion: "3" | |
provider: | |
name: aws | |
stage: dev | |
runtime: nodejs12.x | |
custom: | |
STAGE: ${opt:stage, 'dev'} | |
stagedCustomDomainProps: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aws ecr get-login-password --region us-west-1 | docker login --username AWS --password-stdin XXXXXXXXX.dkr.ecr.us-west-1.amazonaws.com/hello_word_expressjs_app && | |
docker build -t hello_world_expressjs_app . && | |
docker tag hello_world_expressjs_app:latest XXXXXXXX.dkr.ecr.us-west-1.amazonaws.com/hello_world_expressjs_app:latest && | |
docker push XXXXXXXXX.dkr.ecr.us-west-1.amazonaws.com/hello_world_expressjs_app:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:12.4-alpine | |
RUN mkdir /app | |
WORKDIR /app | |
COPY package.json . | |
RUN npm install && mv node_modules /node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const port = 80; | |
app.get('/', (req, res) => { | |
res.send("Hello World!"); | |
}); | |
app.listen(port, () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Coupon | |
def handler(event, context): | |
for event in event["Records"]: | |
if event["eventName"] == "ObjectCreated:Put": | |
image_full_name = event["s3"]["object"]["key"] | |
Coupon.process_and_store(image_full_name) | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import os | |
import boto3 | |
import base64 | |
import io | |
import pytesseract | |
from PIL import Image | |
from base64 import b64encode | |
from typing import List |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pydantic import BaseModel | |
from typing import List | |
from fastapi import FastAPI | |
from mangum import Mangum | |
import Coupon | |
class AddCouponRequest(BaseModel): | |
user_id: str |
NewerOlder