<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                一、路由: ![](https://box.kancloud.cn/9e0f69564b13d110c4923b8216562c1e_836x462.png) index.js ~~~ var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'Express' }); }); router.get('/helloworld', function(req, res, next) { res.render('helloworld', {}); }); module.exports = router; ~~~ user.js ~~~ var express = require('express'); var router = express.Router(); /* GET users listing. */ router.get('/', function(req, res, next) { res.send('respond with a resource'); }); module.exports = router; ~~~ 如果在瀏覽器中訪問localhost:3000,index.js中以下方法會響應 router.get('/', function(req, res, next) { res.render('index', { title: 'Express' }); }); 如果在瀏覽器中訪問localhost:3000/helloworld,index.js中以下方法會響應 router.get('/helloworld', function(req, res, next) { res.render('helloworld', {}); }); 如果在瀏覽器中訪問localhost:3000/users,user.js中以下方法會響應 router.get('/', function(req, res, next) { res.send('respond with a resource'); }); 如果是post請求, router.post(); 二、靜態資源 app.js中以下代碼負責配置靜態資源,代表靜態資源在public ~~~ app.use(express.static(path.join(__dirname, 'public'))); ~~~ ![](https://box.kancloud.cn/54f61e9fcc1399cab59ad1fbf0f81e2c_228x401.png) 訪問靜態資源路徑如下: http://localhost:3000/html/helloword.html http://localhost:3000/stylesheets/style.css 在路由中跳轉靜態頁面: ~~~ router.get('/helloworld', function(req, res, next) { res.redirect("html/helloworld.html"); }); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看