Git Product home page Git Product logo

json-server's Introduction

json-server

Json server powered by express.js that works on AWS Lambda

This project provides a json mock server which can be deployed on AWS Labda leveraging serverless-http core functionalities.

How to install

There is no installation so to say, you just have to clone this repo and you are good to go.

git clone https://github.com/ItsBhatt/json-server.git

Overview

json-server takes advantage of serverless-http package which acts as a wrapper and exported as a handler supported by AWS Lambda. It can be deployed on serverless functions as well as on normal servers.

Structure

  • helpers -> Parsing the req + generating response
  • db.json -> Mock data which will be used for response generation
  • index.js -> Root File
  • routes.js -> express server routes

Usage

After clonning the repo you can simply add you mock json data inside db.json on the root directory.

Deployment

It can be deployed on any platform(server/serverless) and it works seamlessly.

AWS-Lambda

Asuming you have already created api and lambda function

Step 1 - Just create a .zip of all files including node_modules.
Step 2 - Open your labda function and upload the .zip file.
Step 3 - Add a environment variable ENVIRONMENT=production.
Step 4 - Deploy the function ๐ŸŽŠ .

Other

You can simply deploy this as an express app on any server.

json-server's People

Contributors

itsbhatt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

pkhamdee 7code-io

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.