Comp-490-SeniorProject / site

MIT License
0 stars 1 forks source link

Route the API endpoints #39

Closed MarkKoz closed 2 years ago

MarkKoz commented 2 years ago

You can confirm it works by sending a GET request to http://127.0.0.1:8000/api/. This should return a dictionary of supported endpoints:

{
    "devices": "http://127.0.0.1:8000/api/devices/",
    "notification_settings": "http://127.0.0.1:8000/api/notification_settings/",
    "parameters": "http://127.0.0.1:8000/api/parameters/",
    "tests": "http://127.0.0.1:8000/api/tests/",
    "test_history": "http://127.0.0.1:8000/api/test_history/"
}

Note that user session authentication is enabled by default for all endpoints, so it may not be feasible to use them without first disabling that (comment out the DEFAULT_AUTHENTICATION_CLASSES key+value in web/settings.py). Even then, I think the endpoints rely on at least 1 user existing to work, and there's currently no endpoint for registering users (though I suppose one could be created tediously in the Django shell).