This is a simple application that demonstrates the use of Cross-Origin Resource Sharing (CORS). It consists of a client and a server. The client sends a request to the server, and the server responds to the request.
- Client-server communication using CORS
- Visual feedback in the client when the server responds
- Node.js
- npm
- Clone the repository to your local machine.
- Navigate to the
client
directory and runnpm install
to install the client dependencies. - Navigate to the
server
directory and runnpm install
to install the server dependencies.
No additional configuration is required.
To start the server, navigate to the server
directory and run npm start
.
To start the client, navigate to the client
directory and run npm start
.
Open a web browser and navigate to http://localhost:3000
to view the client.
Click the "Ping Backend" button in the client to send a request to the server. The server will respond and the client will display the response.
If you encounter a "Failed to load resource: the server responded with a status of 404 (Not Found)" error, make sure that the server is running and that the client is correctly configured to send requests to the server's URL.