Skip to content

magacek/practicum3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prime Number Checker Frontend

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.

Features

  • User authentication (login/logout)
  • Prime number checking
  • Responsive design

How to Use

  1. Register a user using the backend API (via Postman or similar tool)
  2. Open the index.html file in a web browser
  3. Log in with your registered username and password
  4. Enter a number to check if it's prime
  5. Logout when finished

API Endpoints

The application connects to the following endpoints:

  • /auth/login - For user authentication
  • /primes/{n} - For checking if a number is prime

Configuration

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";

Technologies Used

  • HTML5
  • CSS3
  • JavaScript (ES6+)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published