Skip to content

Kv space#1

Open
Rex2516S wants to merge 3 commits into
tmxk2020:mainfrom
Rex2516S:kv-space
Open

Kv space#1
Rex2516S wants to merge 3 commits into
tmxk2020:mainfrom
Rex2516S:kv-space

Conversation

@Rex2516S

Copy link
Copy Markdown

用kv 来代替d1数据库,目前仅有收藏夹功能

Add a serverless favorites API and a client-side sync module.

- New functions/starlist.txt.ts: implements GET (text or JSON), POST (add song(s)), DELETE (remove), PUT (replace list) handlers, CORS support and JSON/text responses, and persists data to SOLARA_STORAGE KV. Includes deduplication, error handling and formatted text export.
- New js/favorites-storage.js: client-side module exposing window.SolaraFavoritesStorage with init, add/remove/toggle, batch add, clear, import/export, sync, and change callbacks; automatically loads cloud data and keeps local state in sync.
- index.html: include the new favorites-storage.js script.

This enables cross-device/cloud-synced favorites management via the /starlist.txt endpoint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant