Created
November 28, 2022 22:06
-
-
Save ProfAvery/c16f39768c6bcf7aa58ce9fc09564a61 to your computer and use it in GitHub Desktop.
CPSC 349 - Files for Fall 2022 Exercise 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const USERNAME = 'ADMIN_EMAIL' | |
const PASSWORD = 'ADMIN_PASSWORD' | |
const pb = new PocketBase('http://127.0.0.1:8090') | |
const authData = await pb.admins.authWithPassword(USERNAME, PASSWORD) | |
console.log(authData) | |
const root = ReactDOM.createRoot(document.getElementById('root')) | |
root.render( | |
<React.StrictMode> | |
<App /> | |
</React.StrictMode> | |
) | |
function App () { | |
return ( | |
<div className='App'> | |
<h1>Hello, {authData.admin.email}</h1> | |
</div> | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>CPSC 349 - Exercise 4</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script type="module" src="app.js"></script> | |
</head> | |
<body> | |
<div id="root"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment