transloadit / uppy-server

[DEPRECATED] 'Uppy Server' was renamed to 'Companion' and lives inside the Uppy repo no
https://github.com/transloadit/uppy/tree/master/packages/%40uppy/companion
MIT License
114 stars 27 forks source link

No session/body attached to req object. Exiting dispatcher. #60

Closed lucax88x closed 6 years ago

lucax88x commented 6 years ago

Hi guys,

First of all, great client & great server, I'm in love with it.

I've setupped a node server to use both tus-node-server for the tus resumable uploads & uppy-server for the google / dropbox / instagram providers.

Tus uploads are fine, I'm having issues with the uppy-server, when I click 'connect to dropbox' button on my local app, I get this error from uppy-server

uppy-server: No session/body attached to req object. Exiting dispatcher.
:1 - - [01/Feb/2018:13:59:35 +0000] "GET /dropbox/connect?state=somestate HTTP/1.1" 404 154 "http://localhost:4300/web/document/add" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"

this is my code.

const app: any = express();

app.use(morgan('combined'));
app.use(cors({
  origin: 'http://localhost:4300',
  credentials: true
}));

app.use(bodyParser.json())

const options = {
  providerOptions: {
    google: {
      key: "***",
      secret: "***"
    },
    dropbox: {
      key: "***",
      secret: "***"
    },
    instagram: {
      key: "***",
      secret: "***"
    }
  },
  server: {
    host: "localhost:3020",
    protocol: "http"
  },
  filePath: "files",
  endSelfEndpoint: "localhost:3020",
  secret: 'mysecret',
  uploadUrls: ['http://localhost:3020'],
  debug: true
}

app.use(uppy.app(options));

What am I doing wrong?

Thanks! Luca

ifedapoolarewaju commented 6 years ago

@lucax88x thank you for your kind words :)

The issue is that you need to use expression-session along with uppy-server.

Here's an example usage of uppy-server https://github.com/transloadit/uppy-server-example/blob/master/index.js#L4-L13

lucax88x commented 6 years ago

Daaaaaaaaamn...

can you please add this on the docs of uppy-server? :)

Thanks! Luca