Project developed for the Concurrent Programming discipline.
2022.2 | UFCG
This API provides endpoints to upload and download files. It was inspired by the Google Drive file system management.
-
Clone the repository:
git clone git@github.com:AlefAdonis/GoGo-Drive.git
-
Go to project directory:
cd GoGo-Drive
-
Build & Run the server:
go build src/*.go && go run src/*.go
-
Run testes:
You should open a new instance of your terminal and the server must be online.
./tests.sh
If you wanna try run the server with a docker. Try:
sudo docker compose up
Endpoint: POST /upload
Uploads a file to the server.
If the file is not in the same directory, insert the full path to upload!
Example:
curl -X POST -F "file=@/path/to/file" localhost:8081/upload
Endpoint: GET /files
Lists all uploaded files.
Example:
curl localhost:8081/files
Endpoint: GET /download/:filename
Downloads a file with the specified filename.
Example:
curl -OJ localhost:8081/download/doc.txt
Endpoint: DELETE /delete/:filename
Deletes a file with the specified filename.
Example:
curl -X DELETE localhost:8081/delete/doc.txt