https://github.com/kennethnym/miro3d-proxy
https://github.com/kennethnym/miro3d-proxy
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kennethnym/miro3d-proxy
- Owner: kennethnym
- Created: 2021-11-20T21:19:04.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-21T05:51:10.000Z (over 3 years ago)
- Last Synced: 2025-01-20T06:45:34.285Z (4 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Miro3D Proxy Server
This is a simple Node.js server that acts as a proxy to query Miro REST API for Miro3D's web plugin client.
## Prerequisites:
- NodeJS v16
- Yarn v1## Why?
The way web plugins are rendered in Miro prohibits them from querying Miro's REST API due to
CORS limitation. This server circumvents the limitation by acting as a standalone server
that helps clients queries Miro REST APIs on their behalf.## Getting started
First, create a `.env` file according to `.env.sample`.
- `ACCESS_TOKEN`: The access token that is used to authenticate against Miro REST API.To start the server, simply run `yarn start`.
## Endpoints
### `POST /upload`
This endpoint is called to upload a picture to a Miro board.
#### Query parameters
| Parameter | Type | Description |
| :-------- | :------- | :------------------------------------------- |
| board | `string` | The ID of the board the picture is stored on |#### Headers
- `Content-Type`: `'application/json'`
#### Body
- Type: `application/json`
- Fields:
- `image`: A data URL representation of the image to be uploaded in base64#### Response
- Type: `application/json`
- Fields:
- `imageUrl`: The URL pointing to the image.