zoukankan      html  css  js  c++  java
  • 跟我一起从零开始一个预告片电影网站(二)

    接下来我们完成一个服务端返回html静态页面
    第一步

    cd server/
    mkdir tpl
    cd tpl
    touch normal.js
    
    //normal.js
    module.exports=`
    <!DOCTYPE html>
    <html>
        <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <title>Koa Server Html</title>
        <script src="https://cdn.bootcss.com/jquery/3.2.0/jquery.min.js" type="javascript"></script>
        <link href="https://cdn.bootcss.com/twitter-bootstrap/4.4.1/css/bootstrap.min.css"  rel="stylesheet" type="text/css"/>
        <script src="https://cdn.bootcss.com/twitter-bootstrap/4.0.0/js/bootstrap.bundle.min.js" type="javascript"></script>
        </head>
            <div class="container">
                <div class="row">
                    <div class="col-md-8">
                        <h1>Hi Luke</h1>
                        <p> this is scott</p>
                    </div>
                    <div class="col-md-4">
                        <p>测试静态HTML页面</p>
                    </div>
                </div>
               
            </div>
    </html>
    `
    
    touch index.js
    
    //tpl/index.js
    const normalTpl = require('./normal')
    module.exports={
        normal:normalTpl
    }
    

    运行代码

    npm start
    

    页面效果为

    按道理说应该一行显示的不知道为什么不是一行,应该是cdn的问题

  • 相关阅读:
    svn上传文件钩子
    linux服务器版svn安装
    csp-s模拟55
    csp-s模拟54
    csp-s模拟53
    csp-s模拟52
    csp-s模拟51
    csp-s模拟50
    csp-s模拟49
    csp-s模拟48
  • 原文地址:https://www.cnblogs.com/smart-girl/p/12514402.html
Copyright © 2011-2022 走看看