-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
41 lines (38 loc) · 1.09 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>feathers custom methods test</title>
<style>
#output {
padding: 1em;
font-size: 300%;
min-height: 0;
background-color: lightgreen;
}
</style>
</head>
<body>
<div id="output"></div>
<script src="/node_modules/feathers-client/dist/feathers.js"></script>
<script type=module>
import customMethods from './client.js'
const app = feathers()
app.configure(feathers.rest().fetch(fetch))
app.configure(customMethods({
methods: {
email: ['send']
}
}))
let output = document.getElementById('output')
app.service('email').send('test@me.com', 1234, [true, null]).then(res => {
output.innerText = `${res} \n Please close browser.`
}).catch(err => {
document.getElementById('output').innerText = `${err} \n Please close browser.`
output.style.backgroundColor = 'lightcoral'
})
</script>
</body>
</html>