GithubHelp home page GithubHelp logo

edgio-docs / edgio-dynamo-db-example Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 0.0 404 KB

An example that shows you how to connect to DynamoDB from within a Layer0 serverless function

JavaScript 100.00%

edgio-dynamo-db-example's Introduction

Deploy DynamoDB example to Layer0

An example that shows you how to connect to DynamoDB from within a Layer0 serverless compute.

Demo

https://layer0-docs-layer0-dynamo-db-example-default.layer0-limelight.link

Try It Now

Deploy with Layer0

Getting Started

Clone This Repo

Use git clone https://github.com/layer0-docs/layer0-dynamo-db-example.git to get the files within this repository onto your local machine.

Install dependencies

On the command line, in the project root directory, run the following command:

npm install

Run the DynamoDB app locally on Layer0

Run the Docusaurus app with the command:

npm run layer0:dev
  • Copy .env.example to .env and fill in your AWS access key and AWS secret key.
  • Create a DynamoDB table named layer0-poc-users and add some records to it.
  • Go to https://localhost:3000
  • You should see the contents of your layer0-poc-users table returned as JSON

Testing production build locally with Layer0

You can do a production build of your app and test it locally using:

npm run layer0:build && npm run layer0:production

Deploying to Layer0

  • Open you site in Layer0 Developer Console, navigate to the default environment, and follow the secrets guide to add your ACCESS_KEY and SECRET_KEY.
  • Activate the updated environment config. Once the site finishes redeploying, the root URL will return the same JSON data that you see locally.
  • Deploying requires an account on Layer0. Sign up here for free. Once you have an account, you can deploy to Layer0 by running the following in the root folder of your project:
npm run layer0:deploy

See deploying for more information.

edgio-dynamo-db-example's People

Contributors

actions-user avatar markbrocato avatar rishi-raj-jain avatar tristanlee85 avatar

Watchers

 avatar  avatar  avatar  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.