30 lines woo
This commit is contained in:
parent
21f7705970
commit
5a5dbce8ed
|
@ -9,8 +9,6 @@ const sites = fs.readFileSync('./webring.txt', 'utf-8')
|
||||||
// exclude empty lines and lines that start with # because why not
|
// exclude empty lines and lines that start with # because why not
|
||||||
.filter(site => site && !site.startsWith('#'));
|
.filter(site => site && !site.startsWith('#'));
|
||||||
|
|
||||||
console.log(sites);
|
|
||||||
|
|
||||||
// modulo that does the right thing with negatives
|
// modulo that does the right thing with negatives
|
||||||
// https://stackoverflow.com/a/4467559
|
// https://stackoverflow.com/a/4467559
|
||||||
const mod = (n, m) => ((n % m) + m) % m;
|
const mod = (n, m) => ((n % m) + m) % m;
|
||||||
|
@ -29,6 +27,4 @@ express()
|
||||||
.get('/prev', (request, response) => handle(-1, request, response))
|
.get('/prev', (request, response) => handle(-1, request, response))
|
||||||
.get('/next', (request, response) => handle(+1, request, response))
|
.get('/next', (request, response) => handle(+1, request, response))
|
||||||
.get('/list', (_, response) => response.type('txt').send(sites.join('\n')))
|
.get('/list', (_, response) => response.type('txt').send(sites.join('\n')))
|
||||||
.listen(process.env.PORT || 8080, () => {
|
.listen(process.env.PORT || 8080);
|
||||||
console.log('doing the thing');
|
|
||||||
})
|
|
||||||
|
|
Loading…
Reference in a new issue