Jungwoo-An / react-editor-js

⚛️📝The unofficial editor-js component for React
https://codesandbox.io/s/react-editor-js-v2-34bfl
MIT License
961 stars 77 forks source link

Where is the file data during request to server? #21

Closed avillarubia closed 4 years ago

avillarubia commented 4 years ago

Good day guys,

I have a summary of my concern below

const EDITOR_JS_TOOLS = {
    image: {
        class: Image,
        config: {
            endpoints: {
                byFile: 'http://localhost:3001/api/uploads'
            },
            field: 'image',
            types: 'image/*'
        }
    }
}

const CommentEditor = () => {
    return <EditorJs tools={EDITOR_JS_TOOLS} />
}

When my react sends request to

router.post('/', async (req, res) => {
//when client use this endpoint, console.log can display a message
})

but where is the data? I look it to req.body but empty

Thank you.

Jungwoo-An commented 4 years ago

@avillarubia Hi! First of all, thanks for your interest! ❤️

I think you want to change request of upload img. is right? If so, you should follow this section

Thanks!

avillarubia commented 4 years ago

@Jungwoo-An thanks for the response, As I checked, I found out that there is no file upload support other than image (correct me if I am wrong). Do you have plans to implement that idea?

Jungwoo-An commented 4 years ago

@avillarubia Are you talking about static file upload? If so, I don't have plans. 😥

Thanks!

avillarubia commented 4 years ago

Yes @Jungwoo-An

sabit990928 commented 4 years ago

@avillarubia Are you talking about static file upload? If so, I don't have plans.

Thanks!

Is it mean that byFile functionality from "image" library don't work?

Jungwoo-An commented 4 years ago

@sabit990928 No, byFIle function works fine. What I said is image file server that supports upload.