webring/_lambda/next.js
2019-04-13 19:12:48 +02:00

8 lines
243 B
JavaScript

import { redirect, getNext, getRandom } from './common/utils'
exports.handler = function(event, context, callback) {
const { referer } = event.headers
const site = getNext(referer) || getRandom()
callback(null, redirect(site))
}