Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
/ apibone Public archive

[Deprecated] Abstracts requests and responses to make them platform agnostic

License

Notifications You must be signed in to change notification settings

eser/apibone

Repository files navigation

apibone

npm version npm download dependencies license

Update (July 2022)

DEPRECATED in favor of hex. See https://github.com/eserozvataf/hex for details.

README

apibone is a library which provides some interfaces for queryable services. It simply abstracts request and response objects for its defined functions.

apibone modules query various web services and return responses in requested formatting. Whether the platform is cli or web, modules access same interface for input and output objects.

Queries

Apibone breaks queries in three parts:

  • Module name / alias
  • Arguments
  • Parameters

in command line form:

module [arguments ...] [--parameter value ...]

For example, to execute rates module in order to query 5 USD's TRY value:

$ apibone module rates usd try --amount 5 # cli example
http://example.com/rates/usd/try?amount=5 # web example

module: module name which will be called. (e.g.: rates)
arguments: arguments of operation (e.g.: first argument is usd, second argument is try)
parameters: optional settings for operation (e.g.: amount with value 5)

Installation

$ npm install -g apibone
$ mv config.sample.js config.js # rename config.sample.js to config.js

CLI Usage

$ apibone module [arguments]

# Examples:
$ apibone modules
$ apibone rates usd try
$ apibone rates usd try --amount 5
$ apibone weather izmir
$ apibone test anyCommand --anyParam=anyValue --anyOptionalParam

REPL Usage

$ apibone

apibone> modules
apibone> weather izmir
apibone> /q

Web Usage

$ npm start

# Example:
http://localhost:3000/modules
http://localhost:3000/rates/usd/try?amount=5
http://localhost:3000/weather/izmir
http://localhost:3000/test/anyCommand?anyParam=anyValue&anyOptionalParam&format=text

Start as a Telegram Bot

$ node ./lib/telegrambot.js

Start as a Slack Bot

$ node ./lib/slackbot.js

Modules

Requirements

License

MIT, for further details, please see LICENSE file.

Contributing

See contributors.md

It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome.

  • To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
  • To report a bug: If something does not work, please report it using GitHub Issues.

To Support

Visit my patreon profile at patreon.com/eserozvataf

About

[Deprecated] Abstracts requests and responses to make them platform agnostic

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published