Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lowmess/lowm.es. A simple URL shortener lowm.es
Something went wrong. Try again.
1234567891011121314151617181920212223const fs = require('fs')const config = require('./vercel.json')const URLs = require('./redirects.json')
function writeConfig() { const redirects = URLs.map(([source, destination, permanent]) => ({ source, destination, // Kind of weird, but I have to do it this way because the 3rd item in the // array isn't always present (and thus, doesn't have a value) permanent: permanent === false ? false : true, }))
const updatedConfig = { ...config, redirects, }
fs.writeFileSync('./vercel.json', JSON.stringify(updatedConfig, null, 2))}
writeConfig()