https://github.com/hackthacker/api
This repository provided using four different APIs: REST, GraphQL, SOAP, and JSON-RPC. This way, you can compare the design trade-offs, tools, and developer experience.This is about how this works in real life and how this works on a website showing this API.
https://github.com/hackthacker/api
Last synced: 4 months ago
JSON representation
This repository provided using four different APIs: REST, GraphQL, SOAP, and JSON-RPC. This way, you can compare the design trade-offs, tools, and developer experience.This is about how this works in real life and how this works on a website showing this API.
- Host: GitHub
- URL: https://github.com/hackthacker/api
- Owner: hackThacker
- Created: 2025-10-04T15:56:23.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-10-04T16:02:39.000Z (4 months ago)
- Last Synced: 2025-10-04T18:08:28.452Z (4 months ago)
- Language: HTML
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Setup and Run (REST, GraphQL, RPC, SOAP) with index.html
## Prerequisites
- Node.js and npm installed
- Your project folder contains:
- index.html
- graphql-server.js
- rest-server.js
- rpc-server.js
- soap-server.js
## 1) Install dependencies
Open a terminal in your project folder and run:
```bash
npm install express cors body-parser graphql express-graphql xml-js
```
## 2) Open index.html
- Open index.html in your editor and/or browser.
- Make sure any fetch/axios URLs in index.html match your local server ports and paths.
## 3) Run all servers (use split terminals)
Open multiple terminals (or split a terminal) and run each server in its own terminal:
GraphQL:
```bash
node graphql-server.js
```
REST:
```bash
node rest-server.js
```
RPC:
```bash
node rpc-server.js
```
SOAP:
```bash
node soap-server.js
```
Tip (VS Code): Terminal > Split Terminal to run each command side-by-side.
## 4) Use the app
- With all four servers running, refresh index.html in your browser.
- The page should now load and interact with the APIs properly.
## Notes
- If you get “Cannot find module …”, ensure you ran the npm install command in the same folder as your server files.
- If a port is already in use, stop the conflicting process or change the port in the corresponding server file.
- Stop any server with Ctrl + C in its terminal.