Git Product home page Git Product logo

express-mock-poc's Introduction

Express Mock POC

This is a proof of concept (POC) project for a mock server using Express.js. The server provides endpoints for user data and credit check simulations.

Project Structure

  • data/: Contains JSON files for user data and credit check responses.
  • routes/: Contains route handlers for user and credit check endpoints.
  • server.js: The main entry point of the application.

Installation

  1. Clone the repository.
  2. Run npm install to install the dependencies.

Running the Server

You can start the server using the following npm scripts:

  • npm start: Starts the server in the default environment.
  • npm run start:dev: Starts the server in the development environment.
  • npm run start:staging: Starts the server in the staging environment.
  • npm run start:prod: Starts the server in the production environment.

API Endpoints

  • GET /user/:userId: Fetches the data for a user with the given ID.
  • POST /credit-check: Simulates a credit check for the user data provided in the request body.

Testing

To test the server, you can use any HTTP client like curl or Postman. Here are some example requests:

  • Fetch user data: curl http://localhost:3000/user/1
  • Perform a credit check: curl -X POST -H "Content-Type: application/json" -d '{"email": "[email protected]"}' http://localhost:3000/credit-check
  • Appending +highRisk or +lowRisk to the credit check POST body email like this {"email": "[email protected]"} will return low or high risk data (Credit score, risk index, etc.)

express-mock-poc's People

Contributors

patrickpriestley avatar

Watchers

 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.