enkaNetwork
GitHubNPM
  • ✨Overview
  • 📦Quick Start | Installation
  • 🖇️TypeScript usage
  • ⚙️Class description
    • 📝EnkaNetwork
    • 💾AssetsUpdater
    • 🔎AssetsFinder
  • 🔗Methods
    • 👤fetchUser
    • 🕵️fetchProfileInfo
    • 🌟fetchEnkaProfile
    • 📕fetchEnkaHoyos
    • 🔹fetchEnkaHoyo
    • 🟣fetchEnkaHoyoBuilds
    • 🚩setLanguage
  • 🎓Models
    • EnkaProfile
    • Character
      • Character
      • CharacterConstellation
      • CharacterReliquary
      • CharacterSkill
      • CharacterStats
      • CharacterWeapon
    • PlayerInfo
      • CharacterPreview
      • Namecard
      • PlayerInfo
      • ProfilePicture
    • Fetcher
      • FetchEnkaHoyosBuilds
      • FetchEnkaHoyo
      • FetchEnkaProfile
      • FetchUserUID
      • FetchProfileInfo
  • ✏️Examples
    • 1️⃣Simple usage
    • 2️⃣Express API
    • 3️⃣Fastify API
    • 4️⃣Telegram bot
Powered by GitBook
On this page

Was this helpful?

  1. Examples

Fastify API

PreviousExpress APINextTelegram bot

Last updated 1 year ago

Was this helpful?

- fast and low overhead web framework, for Node.js

import Fastify from "fastify";
import { EnkaNetwork } from "enkanetwork";

const fastify = Fastify();
const port = 80;
const enka = new EnkaNetwork();

fastify.get("/:language/:uid", async (req, res) => {
    const { language, uid } = req.params;

    return await enka.fetchUser(uid, language); // error hanling already work! Fastify > Express
});

await enka.assetsUpdater.fetchAssets();
fastify
    .listen({ port, host: "::" })
    .then(() => console.log(`[SERVER] Server listening on port ${port}`));
✏️
3️⃣
Fastify