Import from url no working

I am trying to do import from Url. I checked in example it’s working but it’s no working for me.
Here is my code

require(‘dotenv’).config()
const express = require(‘express’)
const companion = require(‘@uppy/companion’);
const path = require(‘path’);
const app = express()
const port = process.env.PORT ?? 9076
const bodyParser = require(‘body-parser’);
const session = require(‘express-session’);
const cors = require(‘cors’);
app.use(bodyParser.json());
app.use(
session({
secret: ‘hm@4544540’,
resave: true,
saveUninitialized: true,
}),
);
app.get(‘/design’, (req, res) => {
res.sendFile(path.join(__dirname, ‘public’, ‘index.html’));
});
const companionOptions = {
s3: {
getKey: (req, filename) => {
return ${process.env.COMPANION_AWS_PREFIX}${req.filename};
}, // Specify the S3 folder path
secret: process.env.COMPANION_AWS_SECRET, // Return secret key
key: process.env.COMPANION_AWS_KEY, // Pass access key directly
bucket: process.env.COMPANION_AWS_BUCKET, // Bucket name
region: process.env.COMPANION_AWS_REGION, // AWS region
},
providerOptions: {
key: {
key: ‘secret’,
secret:‘secret’,
},
drive: {
key: ‘key’,
secret: ‘secret’,
},
},
server: {
host: ‘localhost:’+port,
protocol: ‘http’
corsOrigins: [‘‘],
},
filePath: ‘./download’,
corsOrigins: [’
’],
secret: ‘secret’,
debug: true,
};
const { app: companionApp } = companion.app(companionOptions);
app.use(cors({
origin: ‘*’, // Allow requests from your client app
//methods: [‘GET’, ‘POST’, ‘OPTIONS’, ‘PUT’, ‘DELETE’, ‘FETCH’],
}));

app.use((req, res, next) => {
res.setHeader(‘Access-Control-Allow-Origin’, req.headers.origin || ‘*’);
res.setHeader(
‘Access-Control-Allow-Methods’,
‘GET, POST, OPTIONS, PUT, PATCH, DELETE’,
);
res.setHeader(
‘Access-Control-Allow-Headers’,
‘Authorization, Origin, Content-Type, Accept’,
);
console.log(Received ${req.method} request for ${req.url});
next();
});

app.use(companionApp);

companion.socket(app.listen(port));
console.log(‘Welcome to Companion!’);
console.log(Listening on http://0.0.0.0:+port);

// === </some plumbing to make the example work> ===

What does “not working” mean? What do you use on the client? What are the errors you’re seeing?

I am getting Cannot POST /url/meta
And the request url is : http://localhost:9076/url/meta

Client side code is
let url = ‘http://localhost:9076/’;
this.uppy = new Uppy.Uppy();
this.uppy.use(Uppy.Url, {
companionUrl: url,
});

Are you not using any UI? Does it work with Uppy’s Dashboard?

Here is client side code

This issue is fixed now.