We have added a new feature to upload images on the main page. This feature allows users to upload image files, which will be processed by the server.
- Open the main page of the application.
- You will see a form to upload images.
- Click on the "Choose File" button to select an image file from your device.
- Click on the "Upload Image" button to upload the selected image.
- The server will process the image and return a response indicating the success of the upload.
The image upload functionality is handled by the /uploadimage/ endpoint. You can use this endpoint to upload image files programmatically.
Example:
POST /uploadimage/
Content-Type: multipart/form-data
File: <image_file>
The server will respond with a JSON object containing the filename and a success message.
We have added a new feature to convert JSON files to CSV format in the server directory. This feature allows users to easily convert JSON data to CSV format for further processing.
- Place the JSON file you want to convert in the server directory.
- Run the
json_to_csv.pyscript located in theserverdirectory. - The script will read the JSON file and create a corresponding CSV file in the same directory.
To convert a JSON file named example.json to a CSV file named output.csv, run the following command:
python server/json_to_csv.py
The script will read the example.json file and create an output.csv file with the converted data.
We have added a new feature to control a cat using the arrow keys on a new page created with canvas. This feature allows users to interact with a cat on a canvas element and control its movement using the arrow keys.
- Open the main page of the application.
- Navigate to the
/cat_canvasendpoint. - You will see a canvas element with a cat drawn on it.
- Use the arrow keys (Up, Down, Left, Right) to control the movement of the cat on the canvas.
The cat control functionality is handled by the /cat_canvas endpoint. You can use this endpoint to access the cat control feature.
Example:
GET /cat_canvas
The server will respond with an HTML page containing the canvas element and JavaScript code to control the cat.
We have added a new feature to play a Tetris game and collect scores using a backend endpoint. This feature allows users to play a Tetris game implemented using JavaScript and HTML5 Canvas, and submit their scores to the backend for storage.
- Open the main page of the application.
- Navigate to the
/tetrisendpoint. - You will see a canvas element with the Tetris game.
- Use the arrow keys (Up, Down, Left, Right) to control the movement of the Tetris pieces.
- The score will be displayed on the screen, and the game will end when the pieces reach the top of the canvas.
The Tetris game functionality is handled by the /tetris endpoint. You can use this endpoint to access the Tetris game.
Example:
GET /tetris
The server will respond with an HTML page containing the canvas element and JavaScript code to play the Tetris game.
The backend score collection functionality is handled by the /submit_score/ endpoint. You can use this endpoint to submit scores to the backend for storage.
Example:
POST /submit_score/
Content-Type: application/json
{
"score": <score_value>
}
The server will respond with a JSON object containing a success message.