Guest User

Untitled

a guest
Oct 8th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. -----
  2. index.html
  3. -----
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  11. <meta name="description" content="">
  12. <meta name="author" content="">
  13.  
  14. <title>Starter Template for Bootstrap</title>
  15.  
  16. <!-- Bootstrap core CSS -->
  17. <link(rel='stylesheet', href='/bootstrap/css/bootstrap.min.css')>
  18. <link(rel='stylesheet', href='/bootstrap/css/bootstrap-responsive.min.css')>
  19.  
  20. </head>
  21.  
  22. <body>
  23.  
  24. <nav class="navbar navbar-inverse navbar-fixed-top">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="#">Project name</a>
  34. </div>
  35. <div id="navbar" class="collapse navbar-collapse">
  36. <ul class="nav navbar-nav">
  37. <li class="active"><a href="#">Home</a></li>
  38. <li><a href="#about">About</a></li>
  39. <li><a href="#contact">Contact</a></li>
  40. </ul>
  41. </div><!--/.nav-collapse -->
  42. </div>
  43. </nav>
  44.  
  45. <div class="container">
  46.  
  47. <div class="starter-template">
  48. <h1>Bootstrap starter template</h1>
  49. <p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>
  50. </div>
  51.  
  52. </div><!-- /.container -->
  53.  
  54.  
  55. <!-- Bootstrap core JavaScript
  56. ================================================== -->
  57. <!-- Placed at the end of the document so the pages load faster -->
  58. <script(src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js')</script>
  59. <script>script(src='/bootstrap/js/bootstrap.min.js')</script>
  60. </body>
  61. </html>
  62.  
  63.  
  64. -----
  65. Server.js
  66. -----
  67.  
  68. var express = require("express");
  69. var app = express();
  70. var router = express.Router();
  71. var path = __dirname + '/views/';
  72.  
  73. app.use('/static', express.static(__dirname + '/bootstrap'));
  74.  
  75. router.use(function (req,res,next) {
  76. console.log("/" + req.method);
  77. next();
  78. });
  79.  
  80. router.get("/",function(req,res){
  81. res.sendFile(path + "index.html");
  82. });
  83.  
  84. // router.get("/about",function(req,res){
  85. // res.sendFile(path + "about.html");
  86. // });
  87.  
  88. // router.get("/contact",function(req,res){
  89. // res.sendFile(path + "contact.html");
  90. // });
  91.  
  92. app.use("/",router);
  93.  
  94. // app.use("*",function(req,res){
  95. // res.sendFile(path + "404.html");
  96. // });
  97.  
  98. app.listen(3000,function(){
  99. console.log("Live at Port 3000");
  100. });
Advertisement
Add Comment
Please, Sign In to add comment