作者: Promise_84fe | 来源:发表于2018-12-03 11:27 被阅读0次

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8" />
    <title>Document</title>
    </head>
    <body>
    <form method="get" action="http://localhost:8080">
    <p>用户名:<input type="text" name="uname"></p>
    <p>密码:<input type="text" name="upwd"></p>
    <p><input type="submit" value="提交"></p>

    </form>
    

    </body>
    </html>

    const express=require('express');
    const expressStatic=require('express-static');
    var server=express();
    server.listen(8080);
    //处理用户请求
    server.use('/',function(req,res){
        console.log(req.query);//解析get发送的数据请求
    })
    server.use(expressStatic('./www'));
    

    2

    const express=require('express');
    const expressStatic=require('express-static');
    var server=express();
    server.listen(8080);
    server.use(expressStatic('./www'));//去哪读取静态目录
    
    
    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Document</title>
    </head>
    <body>
        <h1>我是</h1>
    
    </body>
    </html>
    

    3

    const express=require('express');
    const expressStatic('express-static');
    var server=express();
    server.listen(8080);
    server.use(expressStatic('./www'));//去哪读取静态目录
    

    相关文章

      网友评论

          本文标题:

          本文链接:https://www.haomeiwen.com/subject/gntycqtx.html