constaxios=require("axios");constapp=feathers();constrestClient=rest("http://localhost:3030");app.configure(restClient.axios(axios));// Available options are listed in the "Options" sectionapp.configure(auth({ header:"Authorization",// the default authorization header for REST prefix: "", // if set will add a prefix to the header value. for example if prefix was 'JWT' then the header would be 'Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOi...'
path:"/authentication",// the server-side authentication service path jwtStrategy:"jwt",// the name of the JWT authentication strategy entity:"user",// the entity you are authenticating (ie. a users) service:"users",// the service to look up the entity cookie:"feathers-jwt",// the name of the cookie to parse the JWT from when cookies are enabled server side storageKey:"feathers-jwt",// the key to store the accessToken in localstorage or AsyncStorage on React Native storage: cookieStorage // Passing a WebStorage-compatible object to enable automatic storage on the client. }));//Upload to S3constupload= (acceptedFiles, rejectedFiles) => {var formData =newFormData();formData.append("file", acceptedFiles[0],"chris.jpg"); app.service("uploads").create(formData, { headers: {"content-type":"multipart/form-data" } }).then(res => {alert("upload ends"); }).catch(err => {alert(err.message); }); };//Upload to localconstupload= (acceptedFiles, rejectedFiles) => {var formData =newFormData();formData.append("file", acceptedFiles[0],"chris.jpg"); app.service("uploads-static").create(formData, { headers: {"content-type":"multipart/form-data" } }).then(res => {alert("upload ends"); }).catch(err => {alert(err.message); }); };