adding test html file

This commit is contained in:
Adam 2023-09-06 14:48:32 -05:00
parent d9a144d005
commit 23611eb813
2 changed files with 31 additions and 1 deletions

28
index.html Normal file
View File

@ -0,0 +1,28 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CORS</title>
</head>
<body>
Response: <span id="response"></span>
</body>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$(function() {
$.ajax({
url: 'http://192.168.2.214:3000/',
success: res => {
$('#response').text(res);
},
error: err => {
$('#response').text(err.statusText);
}
})
});
</script>
</html>

View File

@ -2,8 +2,10 @@ const express = require('express')
const app = express()
const port = 3000
let x = 0
app.get('/', (req, res) => {
res.send('Hello World!')
res.send('Hello World!: ' + x);
x++;
})
app.listen(port, () => {