feat: add and refactor fcm script, update readme

- Add xsendReady.ts, a production-ready script for sending FCM notifications.
- Refactor script to be modular, use external config, and handle token validation efficiently.
- Update README.md with more detailed project information, setup instructions, and scripts.
This commit is contained in:
2025-06-30 15:09:35 +08:00
parent 1391482710
commit ae3b8c118d
3 changed files with 289 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
import elysia from "elysia";
import { sendFCMNotification } from "../../../../../../xsend";
import { sendMultiple } from "../../../../../../xsendReady";
@@ -12,7 +13,8 @@ const ApiV2 = new elysia({
'cRz96GHKTRaQaRJ35e8Hxa:APA91bEUSxE0VPbqKSzseQ_zGhbYsDofMexKykRw7o_3z2aPM9YFmZbeA2enrmb3qjdZ2g4-QQtiNHAyaZqAT1ITOrwo9jVJlShTeABmEFYP5GLEUZ3dlLc'
]
await sendFCMNotification('c89yuexsS_uc1tOErVPu5a:APA91bEb6tEKXAfReZjFVJ2mMyOzoW_RXryLSnSJTpbIVV3G0L_DCNkLuRvJ02Ip-Erz88QCQBAt-C2SN8eCRxu3-v1sBzXzKPtDv-huXpkjXsyrkifqvUo')
// await sendFCMNotification('c89yuexsS_uc1tOErVPu5a:APA91bEb6tEKXAfReZjFVJ2mMyOzoW_RXryLSnSJTpbIVV3G0L_DCNkLuRvJ02Ip-Erz88QCQBAt-C2SN8eCRxu3-v1sBzXzKPtDv-huXpkjXsyrkifqvUo')
await sendMultiple()
return {
data: "success elysia api"
};