Create some boilerplate code for index webpage.
This commit is contained in:
12
index.js
12
index.js
@@ -1,12 +1,10 @@
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 3000;
|
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.use(express.static('public'));
|
||||||
res.send('Server is running');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(port, () => {
|
app.listen(3000);
|
||||||
console.log(`Server running on http://localhost:${port}`);
|
|
||||||
});
|
console.log("Codelist app running on port 3000")
|
||||||
|
|||||||
14
public/index.html
Normal file
14
public/index.html
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<title>HTML 5 Boilerplate</title>
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>CodeList</h1>
|
||||||
|
<script src="index.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user