OGP-Generate-API

module
v0.0.0-...-fafbf5e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2023 License: MIT

README

Last commit Repository Stars Issues Open Issues Bug Issues

OGPify 🔖

v1.0-beta2

なんだこれは

この API に任意のテキストを含めて POST をすると、そのテキストを埋め込んだサイト用の OGP を生成します。

🚀 使い方

リポジトリのクローン
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

Directories

Path Synopsis
src
cmd
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL