🚀 使い方
リポジトリのクローン
git clone https://github.com/HidemaruOwO/Ogpify
cd Ogpify
🔨 ビルド
go build src/ogpify.go
💨 実行
CORS 対応のため、--page-domain及び--api-domainフラグが必要です。
もし、このアプリが実行されているサーバーに紐づけられたドメインが api.ogpify.v-sli.me で、POST するためのページのドメインが ogpify.v-sli.meの場合は以下のコマンドのようになります。
順次オプションの値を変更してください。
ローカルで完結させたい場合は不要です。
example.comなどの適当な値を代入してください
./ogpify --api-domain api.ogpify.v-sli.me --page-domain ogpify.v-sli.me
これでサーバーが起動します。
試しに何かしら POST してみてください。
デフォルトポートは3090です。
curl -X POST -H "Content-Type: application/json" -d '{"text" : "これはテストです"}' http://127.0.0.1:3090/generate
❔ ヘルプ
Usage:
[flags]
Flags:
-a, --api-domain string API Domain option (Example: api.ogc.v-sli.me)
-d, --debug Enable this flag causes logging in debug mode
-h, --help help for this command
-p, --page-domain string Domain of the site used for the Post (Example: ogc.v-sli.me)
✈️ POST データ
{
"text": "こちらに45文字以内の文章を入力"
}
📜 ライセンス
MIT License