The namegen5 website.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
300 B

3 years ago
  1. import {collection, reload} from './_names.js';
  2. let lastReload = Date.now();
  3. export function get(req, res) {
  4. if ((Date.now() - lastReload) > 10000) {
  5. reload();
  6. lastReload = Date.now();
  7. }
  8. res.writeHead(200, {
  9. 'Content-Type': 'application/json'
  10. });
  11. res.end(JSON.stringify(collection));
  12. }