demos for spacedust

be a module

maybe this will work for nodejs 18?

+10 -9
+8 -8
server/index.js
··· 1 1 #!/usr/bin/env node 2 2 "use strict"; 3 3 4 - const fs = require('node:fs'); 5 - const http = require('http'); 6 - const jose = require('jose'); 7 - const cookie = require('cookie'); 8 - const cookieSig = require('cookie-signature'); 9 - const webpush = require('web-push'); 10 - const { v4: uuidv4 } = require('uuid'); 11 - const { DB } = require('./db'); 4 + import fs from 'node:fs'; 5 + import http from 'http'; 6 + import * as jose from 'jose'; 7 + import cookie from 'cookie'; 8 + import cookieSig from 'cookie-signature'; 9 + import webpush from 'web-push'; 10 + import { v4 as uuidv4 } from 'uuid'; 11 + import { DB } from './db.js'; 12 12 13 13 // kind of silly but right now there's no way to tell spacedust that we want an alive connection 14 14 // but don't want the notification firehose (everything filtered out)
+2 -1
server/package.json
··· 6 6 "jose": "^6.0.11", 7 7 "uuid": "^11.1.0", 8 8 "web-push": "^3.6.7" 9 - } 9 + }, 10 + "type": "module" 10 11 }