Skip to content

neoxr/open-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPEN-API

JavaScript (ESM) base website script using a plugin as a router that is lightweight and easy to customize.

Open-API

Features

  • Plugin as Router
  • Auto List Feature
  • High Optimation
  • Easy to Customize
  • Show User IP
  • Restrict Access (IP Whitelist)
  • Request Per Minute Limit
  • Suitable for Rest API
  • etc.

Router

This is an example of a router

import { Loader } from '../lib/index.js'
const Scraper = Loader.scrapers

export const routes = {
   category: 'main',
   path: '/api/tempo',
   parameter: ['q'],
   method: 'get',
   execution: async (req, res, next) => {
      const { q } = req.query
      const json = await Scraper.tempo.search(q)
      res.json(json)
   },
   error: false,
   authorize: false,
   rpm: false,
   restrict: false
}

Installation & Run

$ yarn
$ node .

or want to use pm2

$ yarn
$ npm i -g pm2
$ pm2 start pm2.cjs && pm2 logs

Example

/api/tempo?q={query}

Conclusion

Open-API is part of Neoxr API

About

Base Script for API Website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •