{"id":17601072,"url":"https://github.com/sysnee/s3-upload-service","last_synced_at":"2026-01-31T15:01:06.698Z","repository":{"id":258305924,"uuid":"869108950","full_name":"sysnee/s3-upload-service","owner":"sysnee","description":"Multi-Tenant File Upload Service to AWS S3","archived":false,"fork":false,"pushed_at":"2024-10-16T17:27:09.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-13T14:42:28.093Z","etag":null,"topics":["api-gateway","aws","aws-s3","microservice","multi-tenancy","rest-api","s3-bucket","upload-file"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysnee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-07T18:23:42.000Z","updated_at":"2024-10-16T17:27:13.000Z","dependencies_parsed_at":"2024-10-22T17:33:11.180Z","dependency_job_id":null,"html_url":"https://github.com/sysnee/s3-upload-service","commit_stats":null,"previous_names":["sysnee/s3-upload-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sysnee/s3-upload-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnee%2Fs3-upload-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnee%2Fs3-upload-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnee%2Fs3-upload-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnee%2Fs3-upload-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysnee","download_url":"https://codeload.github.com/sysnee/s3-upload-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysnee%2Fs3-upload-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28946049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","aws","aws-s3","microservice","multi-tenancy","rest-api","s3-bucket","upload-file"],"created_at":"2024-10-22T12:08:27.990Z","updated_at":"2026-01-31T15:01:06.681Z","avatar_url":"https://github.com/sysnee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# S3 File Upload Service\n\n## Usage\n\n### Running the Server\n\nTo start the service, run:\n\n```bash\nnpm run start\n```\n\nThis will start the service on the default port (usually 3000). You can adjust the port and other configurations in the `src/main.ts` or as part of your environment variables.\n\n### API Endpoints\n\n#### POST `/upload`\n\nUploads a file to the specified S3 bucket.\n\n- **URL**: `/upload`\n- **Method**: `POST`\n- **Headers**: `Content-Type: multipart/form-data`\n- **Body**:\n\n| Parameter         | Type        | Description                       |\n|-------------------|-------------|-----------------------------------|\n| `file`            | `File`      | The file to be uploaded           |\n| `accessKeyId`     | `string`    | AWS access key ID                 |\n| `secretAccessKey` | `string`    | AWS secret access key             |\n| `region`          | `string`    | AWS region (e.g., `us-east-1`)    |\n| `bucketName`      | `string`    | S3 bucket name                    |\n| `fileName`        | `string`    | Name for the file in the bucket   |\n\n### Frontend Usage Example\n\nYou can use the following code snippet in your front-end (or any Node.js client) to upload a file to the service:\n\n```javascript\nconst axios = require('axios');\nconst { createReadStream, unlinkSync } = require('fs');\nconst FormData = require('form-data');\n\nconst formData = new FormData();\n\nconst fileStream = createReadStream('/path/to/your/file');\nformData.append('file', fileStream);\n\nformData.append('accessKeyId', 'YOUR_ACCESS_KEY_ID'); \nformData.append('secretAccessKey', 'YOUR_SECRET_ACCESS_KEY'); \nformData.append('region', 'YOUR_REGION'); \nformData.append('bucketName', 'YOUR_BUCKET_NAME'); \nformData.append('fileName', 'desired-filename-in-s3');\n\naxios.post('http://localhost:3000/upload', formData, {\n  headers: formData.getHeaders(),\n})\n.then(response =\u003e {\n  console.log('File uploaded successfully:', response.data.url);\n  unlinkSync('/path/to/your/file'); // Remove the local file if needed\n})\n.catch(error =\u003e {\n  console.error('Error uploading file:', error.message);\n});\n```\n\n### Response\n\nIf the file is successfully uploaded, the response will be:\n\n```json\n{\n  \"message\": \"File uploaded successfully\",\n  \"url\": \"https://bucket-name.s3.amazonaws.com/your-file-name\"\n}\n```\n\n### Error Handling\n\nIn case of an error (e.g., missing parameters, AWS credentials issue), the service will respond with a 400 status code and an error message.\n\n### Example Errors:\n\n- **400 Bad Request**: Missing AWS credentials or bucket name\n- **400 Bad Request**: File is missing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysnee%2Fs3-upload-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysnee%2Fs3-upload-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysnee%2Fs3-upload-service/lists"}