Skip to content

e0ipso/subrequests-express-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subrequests Express Example

An example Express app that uses Subrequests.

Set up MySQL

This app depends on a mysql database.

  1. Create a database named test in your MySQL server.
  2. Import the table structures from tables.sql in the database.
  3. Once the tables are created, then import the sample data from dump.sql.
  4. Edit db.js to add your MySQL username and password replacing the root:root section.

Test the API

Make the following requests to understand the exposed API:

[
  {
    "requestId": "customers",
    "action": "view",
    "uri": "/customer"
  },
  {
    "requestId": "users",
    "action": "view",
    "uri": "/user/{{customers.body@$.*.User_id}}",
    "waitFor": ["customers"]
  },
  {
    "requestId": "githubs",
    "action": "view",
    "uri": "https://api.github.com/users/{{users.body@$.*.Github_handle}}",
    "headers": { "User-Agent": "Subrequests" },
    "waitFor": ["users"]
  }
]

About

An example Express app that uses Subrequests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published