Skip to content

Commit

Permalink
making and accessing html pages
Browse files Browse the repository at this point in the history
  • Loading branch information
codingXpert committed Jun 30, 2022
1 parent e5e9ac2 commit 0546f33
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const express =require('express');
const path = require('path');
const port =5000;

const app = express();
const publicPath = path.join(__dirname , 'public');
console.log(publicPath);

//linking all the files of public folder to be render on browser
app.use(express.static(publicPath));

app.listen(port , (err) => {
if(!err){
console.log(`Server is running on the port:: ${port}` )
}
});
17 changes: 17 additions & 0 deletions public/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>About Page</title>
</head>
<body>
<h1>About Page</h1>
<style>
h1{
color: blue;
}
</style>
</body>
</html>
17 changes: 17 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index page</title>
</head>
<body>
<h1>Index page</h1>
<style>
h1{
color: red;
}
</style>
</body>
</html>

0 comments on commit 0546f33

Please sign in to comment.