ryanhugh / searchneu

Search over Classes, Professors and Employees at NEU!
https://searchneu.com
GNU Affero General Public License v3.0
74 stars 18 forks source link

Clean up the API #101

Open ryanhugh opened 5 years ago

ryanhugh commented 5 years ago

Right now, we are SCPing up all these files to prod:

Would it be possible to load the data from either the first two files (or elasticsearch directly) when someone hits the API? This way we can avoid SCPing up a lot of duplicate files to the production server.

https://github.com/ryanhugh/searchneu/blob/master/docs/API.md

dajinchu commented 4 years ago

So I think ideally we add a /classes/:school/:termId/:subject/:classId endpoint and hit Elasticsearch (notice that the path is literally the classHash). So for example GET /classes/neu.edu/201930/CS/2500

Additionally, we could support collection URLs like GET /classes/neu.edu/201930 to return all Fall course data, and even GET /classes/neu.edu. All of these would hit Elasticsearch.To avoid bricking the server with these potentially massive payloads, we would probably paginate these queries.