42api-client 中文文档教程

发布于 3年前 浏览 47 更新于 3年前

42api-client

About The Project

这个项目是一个 42api 客户端包装器 api。 它将允许您在未来的应用程序中轻松连接 42API。 42api 客户端是用 nodeJS 编写的,因此在后端和前端都兼容。

Built With

  • Nodejs
  • Axios
  • dotenv
  • eslint

(返回页首)

Getting Started

要在您的项目中安装 42api-client 这非常简单,您可以通过 NPM 或下载库并将其放入您的项目模块中。

Installation

  1. Install the paquet npm install 42api-client
  2. Configure your env with the necessary variables as following
  CLIENT_ID=GET_YOURS_FROM_INTRA
  CLIENT_SECRET=GET_YOURS_FROM_INTRA
  ENDPOINT_API=https://api.intra.42.fr/v2
  SCOPES_API=profile public projects elearning tig forum
  SLEEP_TIME=330
  1. Invoke the module as following: const IntraClient = require('42api-client');
  2. TADAM :D

返回顶部

Usage

为了让您了解如何使用该库,您可以查看examples 文件夹或以下示例:

const payload = {
    'filter[campus_id]': 40,
    sort: 'begin_at',
  };
  const res = await ic.get('exams', {}, payload);
  console.log(res.data);

Roadmap

  • [] Use retry variable instead of sleep
  • [] Improve error handling
  • [] ???

如果您有任何建议,请在官方存储库上打开一个问题。

返回顶部

License

根据 MIT 许可证分发。

Contact

Salim Aouas (@Signal) - signal@42madrid.com

返回顶部

42api-client

About The Project

This project is a 42api client wrapper api. It will allow you to interface 42API easily in your future applications. The 42api client is written in nodeJS so will be compatible on backend side but also in front end side.

Built With

  • Nodejs
  • Axios
  • dotenv
  • eslint

(back to top)

Getting Started

To install the 42api-client in your project this is very easy, you can do it through NPM or download the library and put it on your project modules.

Installation

  1. Install the paquet npm install 42api-client
  2. Configure your env with the necessary variables as following
  CLIENT_ID=GET_YOURS_FROM_INTRA
  CLIENT_SECRET=GET_YOURS_FROM_INTRA
  ENDPOINT_API=https://api.intra.42.fr/v2
  SCOPES_API=profile public projects elearning tig forum
  SLEEP_TIME=330
  1. Invoke the module as following: const IntraClient = require('42api-client');
  2. TADAM :D

(back to top)

Usage

To give you an idea about how to use the library you can check the examples folder or the following example:

const payload = {
    'filter[campus_id]': 40,
    sort: 'begin_at',
  };
  const res = await ic.get('exams', {}, payload);
  console.log(res.data);

Roadmap

  • [] Use retry variable instead of sleep
  • [] Improve error handling
  • [] ???

If you have any suggestion, please open an issue on the offical repository.

(back to top)

License

Distributed under the MIT License.

Contact

Salim Aouas (@Signal) - signal@42madrid.com

(back to top)

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文