Skip to content

A nodeJS example for connecting and using international hellenic university's API

License

Notifications You must be signed in to change notification settings

alexandrosmagos/iee-ihu-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

an API example

A simple API example using International Hellenic University's API in NodeJS.
Report Bug · Request Feature · API Docs

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Acknowledgments

About The Project

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! :)

(back to top)

Built With

  • nodeJS

(back to top)

Libraries Used

  • Express - Web Application Framework & Routes
  • Axios - HTTP client used for GET & POST requests
  • express-session - Creating sessions
  • chalk - Colors on console logs

(back to top)

Getting Started

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.

Prerequisites

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.

Installation

  1. Clone the repo
    git clone https://github.com/alexandrosmagos/iee-ihu-api-example.git
  2. Install NPM packages
    npm install
  3. Rename the '.env.example' to '.env'
  4. 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

(back to top)

Usage

  1. Run the app
    npm run dev - To run it with nodemon
    node app - To run it normally
  2. Open your browser to localhost:3000, or a diffrent port if changed.
  3. Observe console going through the steps, while authentication.
  4. If everything goes correctly, it should be like this:

Usage

(back to top)

See the open issues for a full list of proposed features (and known issues).

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under The Unlicense License. See LICENSE for more information.

(back to top)

Acknowledgments

By Using this project, you agree to the following:

  • I am not responsible for any wrong use of the API.

(back to top)

About

A nodeJS example for connecting and using international hellenic university's API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published