import Database from '@withkoji/database';
const getUploadURL = async (req, res) => {
try {
const { filename } = req.body;
const db = new Database({
projectId: res.locals.KOJI_PROJECT_ID,
projectToken: res.locals.KOJI_PROJECT_TOKEN,
});
const data = await db.generateSignedUploadRequest(filename);
res.status(200).json({ data });
} catch (err) {
console.log('err', err);
res.status(500).json({ err: err.toString() });
}
};
export default getUploadURL;