{"id":19437972,"url":"https://github.com/architect/macro-upload","last_synced_at":"2025-04-24T21:32:37.790Z","repository":{"id":54298449,"uuid":"211556186","full_name":"architect/macro-upload","owner":"architect","description":"A macro for creating an S3 bucket for processing direct uploads with a Lambda function","archived":false,"fork":false,"pushed_at":"2021-09-29T16:03:54.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T12:02:07.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/architect.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":"security.js","support":null}},"created_at":"2019-09-28T20:12:10.000Z","updated_at":"2024-09-30T23:37:49.000Z","dependencies_parsed_at":"2022-08-13T11:20:34.900Z","dependency_job_id":null,"html_url":"https://github.com/architect/macro-upload","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fmacro-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fmacro-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fmacro-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/architect%2Fmacro-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/architect","download_url":"https://codeload.github.com/architect/macro-upload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250713155,"owners_count":21475138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-10T15:16:24.996Z","updated_at":"2025-04-24T21:32:37.522Z","avatar_url":"https://github.com/architect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arc-macro-upload\n\nCreates an S3 bucket for direct uploading and a Lambda function for processing direct uploads.\n\n## Add to your project\n\n```bash\nnpm i @architect/macro-upload\n```\n\nAnd add to your `.arc` file:\n\n```arc\n@app\ntestapp\n\n@http\nget /\nget /success\n\n@macros\narchitect/macro-upload\n```\n\n## Render the upload form\n\nTo render the upload form add the macro to any Lambdas you want to render the form. For the example `.arc` above:\n\n```bash\ncd src/http/get-index \nnpm i @architect/macro-upload\n```\n\nAnd then in the function code:\n\n```javascript\nlet form = require('@architect/macro-upload/form')\n\nexports.handler = async function http(req) {\n  let headers = {'content-type': 'text/html; charset=utf8'}\n  let redirect = `https://${req.headers.Host}/staging/success`\n  let body = form({redirect})\n  return {headers, body}\n}\n```\n\nFor a complete example see [arc-example-macro-upload](https://github.com/architect-examples/arc-example-macro-upload)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fmacro-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchitect%2Fmacro-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchitect%2Fmacro-upload/lists"}