1
0
Fork
You've already forked berzanjs-api
0
Deprecated! See Eduprox
  • JavaScript 90.6%
  • HTML 9.4%
Find a file
2020年12月03日 08:24:38 +00:00
html Update link 2020年01月20日 15:52:02 +01:00
scratchfiles Move to own directory 2020年01月23日 15:48:52 +01:00
.gitignore Initial commit 2020年01月08日 13:08:33 +01:00
LICENSE Add LICENSE 2020年01月18日 20:22:05 +00:00
package-lock.json Initial commit 2020年01月08日 13:08:33 +01:00
package.json Use proper SPDX identifier 2020年02月03日 21:20:08 +01:00
README.md Update eduprox link 2020年12月03日 08:24:38 +00:00
server.js Don't hardcode class GUID 2020年01月31日 14:52:02 +01:00

Note: Deprecated in favour of Rust rewrite: https://gitlab.com/libredu/eduprox

If someone is interested in updating this to work with the new API schema, feel free to send a merge request, I'll be happy to review it and likely merge it, but I do not plan to work on this further myself.

The Berzan.js API Proxy

What's this?

Once upon a time, Berzan.js could get away with only being a frontend for the then called Novasoftware schedule API. As Berzeliusskolan (Berzan) eventually switched over to Skola24, the schedule provider's new API, this was no longer the case due to how CORS works.

This is an API that proxies requests in order to bypass the CORS restrictions so that Berzan.js can utilise the new API.

How to use

Despite this being built for Berzan.js, anyone can use this for their own Skola24 frontends! Information about how is coming soonTM.

Setting up and running yourself

System software requirements

Running the Berzan.js API Proxy yourself requires Node.js and npm. The code was originally written for Node.js 12, the current LTS version at the time of writing, but will most likely work well on later versions too.

Setting up

Start by running npm install to fetch all dependencies. The code only requires an implementation of fetch(). I choose node-fetch, but it could most likely be switched out for something else.

After that, you're done!

Running the server

Running the server is done via the npm start command. If you want it to run on a different port than 8080, set the PORT environment variable, like so: PORT=8084 npm start

License

The Berzan.js API Proxy is licensed under the Mozilla Public License, version 2.0. A copy of it should have been provided with the source code, but in the situation this was not the case, you can access the license here: https://www.mozilla.org/en-US/MPL/2.0/