vipickering / mastr-cntrl

A Micropub Microservice
MIT License
26 stars 2 forks source link

Use Multer to upload the images to my own website #17

Closed vipickering closed 5 years ago

vipickering commented 6 years ago

Support uploading images by using Multer and creating a media endpoint.

https://www.w3.org/TR/micropub/#media-endpoint

vipickering commented 5 years ago
  1. Build a non-auth endpoint that accepts an image in the correct format and POSTs to Github API correctly.

  2. Make it work from a Micropub site

  3. Add Auth and verify it still works.

vipickering commented 5 years ago

The Media Endpoint processes the file upload, storing it in whatever backend it wishes, and generates a URL to the file. The URL should be unguessable, such as using a UUID in the path. If the request is successful, the endpoint must return the URL to the file that was created in the HTTP Location header, and respond with HTTP 201 Created. The response body is left undefined.

  1. Upload the file
  2. Encode it and POST it to Github API
  3. Return success, then generate the unguessable URL
  4. Return the file location in the location header, responding with a 201
vipickering commented 5 years ago

done