Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tristanpoland/parrot-cf-v3
A basic JS api that simulates responses from the V3 Cloud Foundry API
https://github.com/tristanpoland/parrot-cf-v3
Last synced: 14 days ago
JSON representation
A basic JS api that simulates responses from the V3 Cloud Foundry API
- Host: GitHub
- URL: https://github.com/tristanpoland/parrot-cf-v3
- Owner: tristanpoland
- License: apache-2.0
- Created: 2024-11-08T21:20:32.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-08T21:20:33.000Z (about 2 months ago)
- Last Synced: 2024-12-08T18:37:23.872Z (17 days ago)
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mock CF API Server
## Directory Structure
```
mock-api/
├── server.js
├── package.json
└── data/
├── apps.json # List of all apps
├── apps/ # Individual app details
│ ├── app-guid-1.json
│ └── app-guid-2.json
├── spaces.json # List of all spaces
├── spaces/ # Individual space details
│ └── space-guid-1.json
├── events.json # List of all events
├── services.json # List of all services
├── user.json # User profile data
└── stats.json # System statistics
```## Usage
1. Install dependencies:
```bash
npm install
```2. Start the server:
```bash
node server.js
```3. Default credentials:
- Username: admin
- Password: password## Adding New Data
Simply add new JSON files to the appropriate directory. The server will automatically serve them based on the requested path.
Example paths:
- GET /v3/apps -> serves data/apps.json
- GET /v3/apps/app-guid-1 -> serves data/apps/app-guid-1.json
- GET /v3/spaces -> serves data/spaces.json## Pagination
All list endpoints support pagination using query parameters:
- page: Page number (default: 1)
- limit: Items per page (default: 10)Example: GET /v3/apps?page=2&limit=5