-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.mjs
47 lines (43 loc) · 1.06 KB
/
test.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import express from 'express';
import { SQLite3Driver } from '@nymphjs/driver-sqlite3';
import { Nymph } from '@nymphjs/nymph';
import { Tilmeld } from '@nymphjs/tilmeld';
import createServer from '@nymphjs/server';
import setup from './dist/index.js';
const nymph = new Nymph(
{},
new SQLite3Driver({
filename: ':memory:',
}),
new Tilmeld({
appName: 'My App',
appUrl: 'http://localhost:8080',
cookieDomain: 'localhost',
cookiePath: '/',
setupPath: '/user',
emailUsernames: false,
clientEnabledUIDs: ['test'],
verifyRedirect: 'http://localhost:8080',
verifyChangeRedirect: 'http://localhost:8080',
cancelChangeRedirect: 'http://localhost:8080',
jwtSecret: 'shhhhh',
}),
);
const app = express();
app.use('/rest', createServer(nymph));
app.use(
'/user',
setup(
{
restUrl: 'http://localhost:8080/rest',
},
nymph,
{
allowRegistration: true,
},
),
);
app.listen(8080, () => {
console.log('App is loaded. Go here in your browser:');
console.log(' http://localhost:8080/user/');
});