Closed dylan-thinnes closed 7 years ago
This is also important for integration with AWS lambda.
It would be better to split two core functions of the API into two separate endpoints - there should be factorization and simple pi(x) requests as separate services, and therefore separate endpoints, in the API. This is because while the user's list of the first N primes can factor any number smaller than the (N+1)th prime squared, it can only provide pi(x) for any number it actually has in the list. As such, sometimes the user will have fully factorized a number and will only need pi(x) as a server-provided (C++ provided) service.
The AWS Gateway API endpoint for factorization on aws lambda has been created, currently at
n3dl2qh6kj.execute-api.us-west-2.amazonaws.com/prod/factorize/?number=<number here>
CORS headers have been set which require a specific API key, however. Please look in client/scripts/main.js to see the API key.
I am looking into AWS Route 53 for potentially making the endpoint prettier.
Closing this discussion, continued discussion of a separate non-factorization-related API should be in a different issue, if it is an issue at all.
A REST API is needed so that once can make requests to the url and recieve a parsed set of factors in return.