Skip to content

xtsea/x-api-js

Repository files navigation

Ryzenth JS API V1

Open Source Love Maintenance Last commit Size License PRs Welcome

Troubleshoot

Sometimes errors occur, but we are here to help! This guide covers some of the most common issues we’ve seen and how you can resolve them. However, this guide isn’t meant to be a comprehensive collection of every Ryzenth API V1 issue. For more help with troubleshooting your issue, try:

Cron Job

import cron from 'node-cron';

cron.schedule('*/2 * * * *', () => {
  fetch('https://x-api-js.onrender.com/ping')
    .then(response => {
      console.log('Pinged service:', response.status);
    })
    .catch(error => {
      console.error('Error pinging service:', error.message);
    });
});

Config

  • Allowed Domains configuration settings
export const AllowedDomainList = [
    "https://x-api-js.onrender.com",
    "https://randydev-ryu-js.hf.space",
    "https://ryzenth.randydev.my.id"
];

Template

  • Swagger Document
  • Now check /docs
/**
 * @swagger
 * /api/v1/dl/something:
 *   get:
 *     summary: Template Title
 *     tags: [ALL-Downloader]
 *     parameters:
 *       - in: query
 *         name: query
 *         required: true
 *         description: null
 *         schema:
 *           type: string
 *     responses:
 *       200:
 *         description: Success
 *       400:
 *         description: Bad Request (e.g., missing or invalid URL)
 *       401:
 *         description: Unauthorized (e.g., missing or invalid API key)
 *       500:
 *         description: Internal Server Error
 */

Create file plugins/something.js

const TemplateRoutes = express.Router();

TemplateRoutes.get('/api/v1/dl/something', async (req, res) => {
   try {
        const { query } = req.query;
        const result = await Something(query);
        res.json({ results: result });
    } catch (error) {
        res.status(500).json({ error: error.message });
    }
});

export { TemplateRoutes };
  • Then add TemplateRoutes in index.js
import { TemplateRoutes } from './plugins/something.js';

helper.AppendRoutes(app, TemplateRoutes);

Contributing

We love your enthusiasm! Before submitting contributions, please check these guidelines:

How to Contribute:

  1. Fork this repository
  2. Create a feature branch (git checkout -b cool-feature)
  3. Commit your changes (git commit -m 'Add awesome feature')
  4. Push to your branch (git push origin cool-feature)
  5. Open a Pull Request to our main branch

Contribution Rules:

  • Discuss major changes in an Issue first
  • Test thoroughly before submitting
  • Keep code clean and well-documented
  • Update relevant documentation
  • Follow existing code style

Reporting Bugs:

Found a bug? Help us squash it:

  1. Check existing [Issues] for duplicates
  2. Use the Bug Report template
  3. Include:
    • Version number
    • Steps to reproduce
    • Actual vs. Expected behavior
    • Screenshots (if applicable)

Good First Issues:

New to the project? Look for these tags:

  • good-first-issue - Perfect for beginners!
  • documentation - Great for non-coders
  • translation - Help localize the project

📄 License

MIT License © 2025 Ryzenth Developers from TeamKillerX


🙌 Credits

Developed and maintained by @xtdevs and TeamKillerX


Packages

No packages published

Contributors 3

  •  
  •  
  •