zoukankan      html  css  js  c++  java
  • express使用方法

    参考

    静态网页

    app.js
    var express = require('express');
    var app = express();
     
    app.get('/', function(req, res) {
       res.sendfile('./views/index.html');
    });
     
    app.get('/about', function(req, res) {
       res.sendfile('./views/about.html');
    });
     
    app.get('/article', function(req, res) {
       res.sendfile('./views/article.html');
    });
     
    app.listen(3000);
    
    index.html
    <html>
    <head>
       <title>首页</title>
    </head>
     
    <body>
    <h1>Express Demo</h1>
     
    <footer>
    <p>
       <a href="/">首页</a> - <a href="/about">自我介绍</a> - <a href="/article">文章</a>
    </p>
    </footer>
     
    </body>
    </html>
    
    
    You can change the world with your heart,even a lot of changes sometimes unless you won't geiv up....
  • 相关阅读:
    程序集冲突问题
    Linux 菜鸟学习笔记--系统分区
    gawk
    Ansible
    Linux 网关及路由
    Linux档案与目录管理
    find命令
    sed详解
    FTP服务
    Gentoo安装(虚拟机)
  • 原文地址:https://www.cnblogs.com/xiongwei2017/p/6625285.html
Copyright © 2011-2022 走看看