Add whoami example

This commit is contained in:
Henrik Hüttemann
2023-05-19 17:48:31 +02:00
parent bdf3ef1e52
commit 6ba65443f1
6 changed files with 171 additions and 4 deletions
+10
View File
@@ -0,0 +1,10 @@
import { access_token } from './config/synapse_access_token.json'
import axios from 'axios'
axios.defaults.baseURL = 'http://localhost:8008'
axios.defaults.headers.common['Authorization'] = ` Bearer ${access_token}`
axios.defaults.headers.post['Content-Type'] = 'application/json'
const whoami = axios.get('/_matrix/client/v3/account/whoami')
whoami.then((response) => console.log(response.data))