![Logo](https://github.com/alexandrosmagos/iee-ihu-api-example/raw/master/img/logo.jpg)
A simple API example using International Hellenic University's API in NodeJS.
Report Bug
·
Request Feature
·
API Docs
Table of Contents
Trying to connect to the Uni's API with the OAuth 2 authentication 2-3 years ago, was really confusing to me. So this is a simple example hoping to help someone else, and encourage more awesome apps to be released! :)
- Express - Web Application Framework & Routes
- Axios - HTTP client used for GET & POST requests
- express-session - Creating sessions
- chalk - Colors on console logs
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
-
npm
npm install npm@latest -g
-
API Client ID & Secret
1. Go to https://login.iee.ihu.gr/ 2. Follow the instructions to create a new app. 3. Copy the Client ID and Client Secret for the next steps below.
- Clone the repo
git clone https://github.com/alexandrosmagos/iee-ihu-api-example.git
- Install NPM packages
npm install
- Rename the '.env.example' to '.env'
- Enter your CLIENT_ID, CLIENT_SECRET, and change the Scopes if needed, in
.env
PORT=3000 CLIENT_ID= CLIENT_SECRET= SCOPES=announcements,notifications,profile REDIRECT_URI=http://localhost:3000/callback
- Run the app
npm run dev - To run it with nodemon node app - To run it normally
- Open your browser to localhost:3000, or a diffrent port if changed.
- Observe console going through the steps, while authentication.
- If everything goes correctly, it should be like this:
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under The Unlicense License. See LICENSE
for more information.
By Using this project, you agree to the following:
- I am not responsible for any wrong use of the API.