Improve CI/CD configuration and add unit tests for handler functions
This pull request encompasses multiple changes aimed at enhancing the CI/CD configuration and adding unit tests for handler functions.
The .gitignore file has been updated to include the .scannerwork/ directory, ensuring that Sonar Qube scanner work files are ignored.
A new Sonar Qube configuration file, sonar-project.properties, has been added. This file contains the project key, name, sources, and server URL required for Sonar Qube analysis.
The .woodpecker.yml file has been updated to improve the deployment process for pull requests. This ensures a smoother and more efficient deployment pipeline for pull requests.
The .scannerwork/.sonar_lock and .scannerwork/report-task.txt files have been deleted, removing unnecessary clutter from the repository.
In the handlers.test.js file, unit tests have been added for handler functions to ensure proper rendering and behavior. This improves the reliability and functionality of the application.
In the handlers/index.js file, new handler functions have been added for rendering the home page, about page, tiktok page, serving downloaded videos, and rendering the player page. These functions enhance the application's capability and modularity.
The package.json file has been updated to include Jest as a dev dependency, and a test script has been added to run tests.
In the routes/index.js file, routes have been refactored to utilize the newly added handler functions, improving modularity and readability.
The .woodpecker.yml file has undergone further improvements, removing unnecessary commands and port mapping in the Test stage of the pipeline. In addition, the Test stage has been updated to only run the npm test command, improving efficiency and simplicity.
These changes enhance the CI/CD configuration and add valuable unit tests, improving the functionality and maintainability of the project. Please review and merge this pull request to incorporate these enhancements.