Author: Mohammed Ibrahim Ahmed | github.com/moh-i-ahmed
Description: My implementation of a simple RESTful file server built using Java, Spring Boot & Spring Web. The server provides the following endpoints:
Endpoint | Description |
---|---|
http://localhost:8080/files/ | Retrieves list of all uploaded files with their name and download link |
http://localhost:8080/files/open_me.txt | Downloads the open_me.txt file present in the project |
http://localhost:8080/files/upload | Uploads a file to the server |
This application has been developed and tested only with the following, please ensure you have the Java and Gradle 8.5 versions installed.
Running the application:
-
Open a terminal and navigate to the project's root directory.
cd <path_to_folder_containing_project\File-Server
-
Start the file server using the gradle wrapper command:
.\gradlew bootRun
-
In your browser or using a program such as Postman, access the endpoints described above.
Running the unit tests:
-
Open a terminal and navigate to the project's root directory.
cd <path_to_folder_containing_project\File-Server
-
Run the tests using the gradle wrapper command:
.\gradlew clean test --info
-
The results will be displayed in the terminal and will also be stored in the folder:
File-Server\build\test-results folder
File Server: The file server code is located in the folder File-Server\src\main\java\fileServer\FileServer
Unit tests: The unit tests are located in File-Server\src\test\java\fileServer\FileServer\FileServerEndpointTests.java