Code Monkey home page Code Monkey logo

quote-with-you-backend's Introduction

Serverless Quote Service

A serverless API for picking up famous quotes, with AWS Lambda and DynamoDB. The deployment process is done by Serverless framework. Please also refer to quote-with-you repository for grasping entire application.

Image of Product Product Link: https://quote2you.yutafujii.net

Getting started

  1. Install serverless
$ yarn --global add serverless
  1. code
  2. deploy it

Deploy

Deploy command:

$ sls deploy

This will create CloudFormation JSON and create resources below:

  • AWS Lambda
  • API Gateway HTTP API
  • DynamoDB (1 table)

Where to execute this command depends on how you want to deploy it.

Deploy from your local

Please make sure you're configured the following environment variable:

export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>

If those are set, run sls deploy to deploy.

Deploy through CircleCI

When you push something to master branch, Github action fires sls deploy command. Please make sure you're configured the following environment variable in CircleCI:

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY

NOTE Because this is a pet project, there's no staging/development configuration. If you want those CI/CD pipeline, configure .circleci/config.yml file.

sls invoke local -f function-name -p event.json

Development

Run lambda function locally, create event.json and

$ sls invoke local -f function-name -p event.json

To generate Cloudformation file without deploy, run

$ sls package

# this generates json files in .serverless/ directory

Going further

In a real situation, you might also want to make those APIs available to public.

  • Purchase your own domain
  • Set custom domain to API gateway
  • Add record to your host (Route53)

quote-with-you-backend's People

Contributors

yutafujii0 avatar

Stargazers

tn1994 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.