const movieInfo = require('movie-info')
const movie = 'Crash'
movieInfo(movie)
.then(console.log)
exports.endpoint = async (request, response) => {
// parse GET parameters for ?movie=...&year=...
const url = require('url')
const req = url.parse(request.url, true)
let { name, year } = req.query
response.end(JSON.stringify(await movieInfo(name || movie, year)))
}