I'm trying to execute a simple express script in javascript. Everytime I try I receive an error of "require is not defined". code snippets below... Thanks!
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('An alligator approaches!');
});
app.listen(3000, () => console.log('Gator app listening on port 3000!'));
and the index.html file looks like such...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="basic.js"></script>
</head>
<body>
</body>
</html>