Giter Site home page Giter Site logo

serverless-event-driven-restapi's Introduction

Project Title

Event Driven Serverless REST-API

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purposes.

For production, you will need to add your AWS credentials and remove the serverless offline plugin from serverless.yml file then deploy.

This project has two main parts:

  • Event source
  • REST API which communicate through an event gateway.

Prerequisites

Installing

Install the npm dependencies by running the command below, in both of the folders (event-source & locations-api)

npm install

I uploaded my own enviroment variables file (with fake data) to enable you test the application smoothly ... Please don't do what I did, in a work environment

Run this command below in the locations-api folder to start the DynamoDB locally

sh start-dynamodb.sh

Once done, Set up & Run a local version of the event gateway by following the instructions HERE

Go to event-source folder and run the commands below individually:

  • The first command will create an event type and register a function on the event gateway
  • The second command will start serverless offline
npm run event
npm run start

Go to locations-api folder and run the commands below individually:

  • The first command will register a function and subscribe it to an event on the event gateway
  • The second command will create the DynamoDB table and populate it with some dummy data
  • The third command will start serverless offline
npm run event
npm run seed
npm run start

Now, you are GOOD TO GO !

You can test with the following endpoints in Postman or any API tester of your choice

POST localhost:3001/upload

GET localhost:3000/locations

GET localhost:3000/locations/{location_name}

Roadmap

  • Create a container version of the project to reduce the installation process hurdle

Author

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc

serverless-event-driven-restapi's People

Contributors

didagu avatar

Stargazers

 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.