/astra-api-bridge

Ad Astra Facade API for a more RESTful integration experience with Astra Schedule

Primary LanguageJavaScriptMIT LicenseMIT


Build Status Dependency Status Dev Dependency Status

This is a middleware solution that leverages the facade pattern to provide a simplified RESTful API on top of the existing Astra Schedule API

Get Started

1. Initial Setup

Configure your Astra Schedule envrionment with a username and password that can be used for authentication from this middleware. Consider establishing a 'guest' account with access limited to data that you intend to surface from this facade middleware.

2. Clone the project

git clone https://github.com/adastradev/astra-api-facade.git

3. Install all dependencies

Change into the project directory (e.g. cd astra-api-facade) and run npm install

4. Configure authentication

Create a file called .env and configure it with the site, username, and password you would like to use to connect to the Astra Schedule API (do not include the brackets)

API_USER=[replace_with_username]
API_PASSWORD=[replace with_password]
API_SITE=[replace with site url]

5. Run the tests

npm run test - this will confirm environment data (username/password) is properly read and can connect to Astra Schedule and retrieve data

Run

npm start

This will run the app locally. Open http://localhost:3000 using a web browser to confirm that the middleware is running. You should see Swagger UI documentation for the Astra API Facade.

Browse and test the API right from your browser using the Swaggger UI. You can also utilize a tool like Postman to test and validate the facade.

Running the app in dev mode (npm dev) will cause the Node.js app to automatically reload as you make code changes. If you are testing API from a browser, you will have to refresh the browser page or modify this project to do browser reloading also.

Deploy

Instructions for deployment will be added here, stay tuned!