JSFiddle - React, Tailwind, and code Playground
by Hemanth HM
JavaScript
export async function handler(event, context) {
try {
const name = moviesNames.random().title
const movieURL = await movieTrailer(name)
return {
statusCode: 200,
body: JSON.stringify({url:movieURL})
};
} catch(err) {
return {
statusCode: 200,
err: JSON.stringify({err:err})
};
}
}