Skip to content

Commit

Permalink
Merge pull request #3 from ionicprotocol/test/swagger
Browse files Browse the repository at this point in the history
added swagger and test ci
  • Loading branch information
amish777 authored Jan 20, 2025
2 parents b0fdc92 + 1ff664f commit 7db3d2b
Show file tree
Hide file tree
Showing 7 changed files with 667 additions and 110 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use node alpine image as the base image
FROM node:alpine
# Set working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
RUN npm run build


# Copy the env file
COPY .env .

# # Copy the env.txt file
# COPY env.txt ./

# # Create .env file and copy its content from env.txt
# RUN touch .env && \
# cat env.txt > .env

# Copy the rest of the application files
COPY . .

# Expose port 3000 (assuming your application runs on this port)
EXPOSE 3000

# Command to run the application
CMD ["npm", "run" , "dev"]
54 changes: 46 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,61 @@ A robust and secure REST API for interacting with Ionic Protocol across multiple
npm run dev
```

## 📚 API Endpoints
## 📚 API Documentation

### Supply Assets
### Swagger UI
Access our interactive API documentation at `/api-docs` to:
- Explore all available endpoints
- Test API calls directly from your browser
- View request/response schemas
- Download OpenAPI specification

### Available Endpoints

<details>
<summary><b>Supply Assets</b></summary>

```http
POST /beta/v0/ionic/supply/:chain
```
Supply assets to an Ionic pool.
</details>

### Withdraw Assets
<details>
<summary><b>Withdraw Assets</b></summary>

```http
POST /beta/v0/ionic/withdraw/:chain
```
Withdraw your supplied assets.
</details>

<details>
<summary><b>Borrow Assets</b></summary>

### Borrow Assets
```http
POST /beta/v0/ionic/borrow/:chain
```
Borrow assets from a pool.
</details>

### Repay Loan
<details>
<summary><b>Repay Loan</b></summary>

```http
POST /beta/v0/ionic/repay/:chain
```
Repay your borrowed assets.
</details>

<details>
<summary><b>Get Pool Address</b></summary>

### Get Pool Address
GET /beta/v0/ionic/pool-address/:chain/:asset
Retrieve the pool address for a specific asset.
```http
GET /beta/v0/ionic/market-address/:chain/:asset
```
Retrieve the Market address for a specific asset.
</details>

## 🛠️ Tech Stack

Expand All @@ -96,6 +130,10 @@ This API implements several security measures:

Contributions are welcome! Please feel free to submit a Pull Request.

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## ⚡ Performance

- Optimized for high throughput
Expand Down
Loading

0 comments on commit 7db3d2b

Please sign in to comment.