zoukankan      html  css  js  c++  java
  • 快速本地搭建一个纯静态简易站点

    app.js

    const http = require('http')
    
    const homePage = `
    <!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>Nodejs 部署上线示例(随时失效)</title>
        <style>
            *{
                padding: 0;
                margin: 0;
            }
            body{
                padding: 30px 0;
                text-align: center;
                font-size: 16px;
                background-color: #333;
            }
            h1,h2{
                color: #fff;
            }
            nav{
                 margin-top:20px;
            }
            a{
                color: #ccc;
                text-decoration: none;
            }
            a:hover{
                text-decoration: underline;
            }
        </style>
    </head>
    <body>
        <h1>Nodejs 高级课程</h1>
        <h2>项目部署上线示例</h2>
        <nav>
            <ul>
                <li><a href="/a" target="_blank">Nodejs 电影网站</a></li>
                <li><a href="/b" target="_blank">狗狗说 App后台</a></li>
                <li><a href="/c" target="_blank">微信小程序后台</a></li>
                <li><a href="/d" target="_blank">微信公众号后台</a></li>
            </ul>
        </nav>
    </body>
    </html>
    `
    
    http.createServer((req, res) => {
        res.statusCode = 200
        res.setHeader('Content-Type', 'text/html')
        res.end(homePage)
    })
    .listen(3000, ()=>{
        console.log('Server Running At 3000');
    })

  • 相关阅读:
    Ztree-
    富文本编辑器Ueditor
    通知 弹框
    ResultEntity
    echart
    定时器,定时发邮件JavaMail
    重定向传值
    图片验证码
    异步json发送put或者delete
    异步时间格式转换插件
  • 原文地址:https://www.cnblogs.com/ron123/p/8715223.html
Copyright © 2011-2022 走看看