-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
32 lines (28 loc) · 831 Bytes
/
app.js
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
import React, { useState } from 'react';
import axios from 'axios';
// test comment to piss off vercel.com
function App() {
const [message, setMessage] = useState('');
const [response, setResponse] = useState('');
const sendMessage = async () => {
try {
const res = await axios.post('/api/send', { message });
setResponse(res.data);
} catch (error) {
console.error(error);
}
};
return (
<div className="App">
<h1>AnR2 - A better way to anonymously route your messages.</h1>
<textarea
value={message}
onChange={(e) => setMessage(e.target.value)}
placeholder="Enter your message here"
/>
<button onClick={sendMessage}>Send Message</button>
<div>{response && <p>Response: {response}</p>}</div>
</div>
);
}
export default App;