Giter VIP home page Giter VIP logo

sparkles's Introduction

Hi, I'm Benji.

Not sure what to put here that is not on my website so here's a gif

r/meIRL

sparkles's People

Contributors

benjifs avatar paulrobertlloyd avatar sesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sparkles's Issues

Show server endpoint errors

If an error is encountered, Sparkles shows a message saying ‘An unexpected error has occurred’. However, an endpoint may return an error message, which can be used to help a user fix the error.

For example, if I try to post a movie post, I get an error. Looking at my logs, I can see this is because No configuration provided for watch post type. For Indiekit, the error is returned in a JSON response (https://github.com/getindiekit/indiekit/blob/b5259716be540f2936034d5ddc6e5c673b094fda/packages/indiekit/lib/middleware/error.js#L41-L48).

Whether it be returning the full error response, or any error and/or error_description value returned from a Micropub server, that would help diagnose issues.

media-endpoint not found

I love Sparkles ✨ Such a brilliantly simple Micropub interface.

I tried using it with my own website however, and am getting the error media-endpoint not found when clicking on the image post type.

I have a media endpoint configured, which is advertised when visiting https://kit.paulrobertlloyd.com/micropub?q=config. It returns a number of values, including the following:

{
  
  "media-endpoint": "https://kit.paulrobertlloyd.com/media",
  
}

This works with other clients. Trying to follow where in the code where this value added to the stored config, and from a cursory look it seems like this should work. This config endpoint is also behind authorisation, if that might cause some issues?

(I’m using Indiekit for my Micropub server).

Location endpoint is not returned when uploading media

When uploading media to a mediapub endpoint that returns an empty 201 response on success the location header is not sent to the client.

Looking at the code, it looks like the ...res.headers is not working as expected. I'm going to try to get this working locally and will submit a PR to do it similar to the Note creation endpoint.

Documentation on how to test locally

I can run the application locally using netlify dev, but I can’t authenticate using a third-party IndieAuth endpoint. Right now I’m deploying to Netlify and using console.log to debug changes, which is time consuming and error prone.

Is there a way to test locally, perhaps by providing a placeholder session token (one that could be edited to test different scenarios)? How do you test your changes locally @benjifs?

Can't upload media

Sparkles can now interact with an Indiekit server’s Micropub media endpoint: it is recognised, and previous uploads are shown in the UI:

Image upload interface

If I try to upload an image however, my Indiekit server returns a ‘No file included in request’ error. This is the incoming request:

POST /media
headers {
  host: 'indiekit.up.railway.app',
  accept: '*/*',
  'accept-encoding': 'gzip, deflate, br',
  authorization: 'Bearer XXXXXX',
  'content-length': '61601',
  'content-type': 'multipart/form-data; boundary=----WebKitFormBoundaryMNzWqXaY74EidO2a',
  'user-agent': 'node-fetch',
  'x-forwarded-for': 'XX.XXX.XXX.XX',
  'x-forwarded-proto': 'https',
  'x-envoy-external-address': 'XX.XXX.XXX.XX',
  'x-request-id': 'fc5332d9-cd00-414c-b21d-bd12c6465f60'
}

This is the returned error:

IndiekitError [BadRequestError]: No file included in request
  at IndiekitError.badRequest (file:///app/packages/error/index.js:5:12)
  at actionController (file:///app/packages/endpoint-media/lib/controllers/action.js:33:31)
  at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
  at next (/app/node_modules/express/lib/router/route.js:144:13)
  at Route.dispatch (/app/node_modules/express/lib/router/route.js:114:3)
  at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
  at /app/node_modules/express/lib/router/index.js:284:15
  at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12)
  at next (/app/node_modules/express/lib/router/index.js:280:10)
  at Function.handle (/app/node_modules/express/lib/router/index.js:175:3) {
    code: 'bad_request',
    status: 400
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.