Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
YanxinTang committed Oct 15, 2020
1 parent 4eeb376 commit 595d1e1
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 8 deletions.
46 changes: 38 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,66 @@
# clipboard-online
<div align="center">
<img src="https://raw.githubusercontent.com/YanxinTang/clipboard-online/master/images/clipboard-icon.png" style="display: inline-block; vertical-align: middle;">
<h1 style="display: inline-block; vertical-align: middle;">clipboard-online</h1>
</div>

![GitHub release (latest by date)](https://img.shields.io/github/v/release/YanxinTang/clipboard-online)

clipboard-online is an application to share cilpboard text between Windows and iOS

## Documentation

[中文](https://github.com/YanxinTang/clipboard-online/blob/master/README_zh.md)】【[English](https://github.com/YanxinTang/clipboard-online/blob/master/README.md)

## Download

1. Directly download

Ahho, not complete...
You can download latest release exe from [here](https://github.com/YanxinTang/clipboard-online/releases)

2. From source code(only windows now)

Before you build, make sure you have installed golang. If not, maybe you need [this](https://golang.org/dl/)

- `git clone git@github.com:YanxinTang/clipboard-online.git`
- `cd clipboard-online`
- `./build/build.bat`
- `go get github.com/akavel/rsrc`
- `./build.sh`
- You can find release bin at `release` directory

## Usage

1. Run `clipboard-online` on your windows
2. Setup shortcuts on you iPhone/iPad
3. Have fun...
2. Setup shortcuts on you iPhone/iPad (Open link from safari)
- Copy: [https://www.icloud.com/shortcuts/242c55e0895e4235875bc71f1f010199](https://www.icloud.com/shortcuts/242c55e0895e4235875bc71f1f010199)
- Paste: [https://www.icloud.com/shortcuts/6a46febf2f0c4ef4b00bbc41f03ccd2f](https://www.icloud.com/shortcuts/6a46febf2f0c4ef4b00bbc41f03ccd2f)
3. Have fun...😊

## Configuration

`clipboard-online.exe` will create two file which are `config.json` and `log.txt` in the execute path when first running

You can make customization by editing `config.json`

### `config.json`

- `port`
- type: `string`
- default: `"8086"`

- `logLevel`
- type: `string`
- default: `"warning"`
- values: `"panic"`, `"fatal"`, `"error"`, `"warning"`, `"info"`, `"debug"`, `"trace"`

## API

The default http server will listen `8000` port and you can't chanage that since hardcoded.
The default http server will listen `8086` port and you can't chanage that since hardcoded.

### 1. Get windows clipboard

> Request
- URL: `/clipboard`
- URL: `/`
- Method: `GET`

> Reponse
Expand All @@ -41,7 +71,7 @@ The default http server will listen `8000` port and you can't chanage that since

> Request
- URL: `/clipboard`
- URL: `/`
- Method: `POST`
- Body: `text you want to set`

Expand Down
78 changes: 78 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<div align="center">
<img src="https://raw.githubusercontent.com/YanxinTang/clipboard-online/master/images/clipboard-icon.png" style="display: inline-block; vertical-align: middle;">
<h1 style="display: inline-block; vertical-align: middle;">clipboard-online</h1>
</div>

![GitHub release (latest by date)](https://img.shields.io/github/v/release/YanxinTang/clipboard-online)

clipboard-online 是一款可以帮你在 💻Windows 和 📱iOS 之间分享剪切板的应用

## 文档

[English](https://github.com/YanxinTang/clipboard-online/blob/master/README.md)】【[中文](https://github.com/YanxinTang/clipboard-online/blob/master/README_zh.md)

## 下载

1. 直接下载

[这里](https://github.com/YanxinTang/clipboard-online/releases)下载发布的 .exe 文件

2. 源码编译(只在 Windows 下可用,其他平台未知)

构建之前,请确保你已经安装了 golang. 如果没有,可能你需要[这个](https://golang.org/dl/)

- `git clone git@github.com:YanxinTang/clipboard-online.git`
- `cd clipboard-online`
- `go get github.com/akavel/rsrc`
- `./build.sh`
- 你可以在 `release` 目录下找到可执行文件

## 使用

1. 在 Windows 上运行 `clipboard-online`
2. iPhone 或 iPad 上安装快捷指令 (在 safari 中打开链接)
- 复制: [https://www.icloud.com/shortcuts/242c55e0895e4235875bc71f1f010199](https://www.icloud.com/shortcuts/242c55e0895e4235875bc71f1f010199)
- 粘贴: [https://www.icloud.com/shortcuts/6a46febf2f0c4ef4b00bbc41f03ccd2f](https://www.icloud.com/shortcuts/6a46febf2f0c4ef4b00bbc41f03ccd2f)
3. 玩的开心...😊

## 配置

`clipboard-online.exe` 将在运行路径下面创建两个文件: `config.json` and `log.txt`

你可以通过修改 `config.json` 来自定义配置

### `config.json`

- `port`
- 类型: `string`
- 默认: `"8086"`

- `logLevel`
- 类型: `string`
- 默认: `"warning"`
- 可选: `"panic"`, `"fatal"`, `"error"`, `"warning"`, `"info"`, `"debug"`, `"trace"`

## API

### 1. 获取 Windows 剪切板

> Request
- URL: `/`
- Method: `GET`

> Reponse
- Body: `<clipboard text>`

### 2. 设置 Windows 剪切板

> Request
- URL: `/`
- Method: `POST`
- Body: `text you want to set`

> Reponse
响应的 body 为空。如果剪切板设置成功,状态码将返回 `200`
Binary file added images/clipboard-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 595d1e1

Please sign in to comment.