This is a simple frontend application for checking if a number is prime. It connects to a backend service that provides authentication and prime number checking functionality.
- User authentication (login/logout)
- Prime number checking
- Responsive design
- Register a user using the backend API (via Postman or similar tool)
- Open the
index.html
file in a web browser - Log in with your registered username and password
- Enter a number to check if it's prime
- Logout when finished
The application connects to the following endpoints:
/auth/login
- For user authentication/primes/{n}
- For checking if a number is prime
You can change the API endpoint in the script.js
file by modifying the hosts
object and the environment
variable:
const hosts = {
local: {
primes_service: "http://localhost:4001",
},
remote: {
primes_service: "https://primes-service.onrender.com",
},
};
// Set to 'local' for local development, 'remote' for production
const environment = "local";
- HTML5
- CSS3
- JavaScript (ES6+)