{"id":113614,"date":"2026-10-07T00:09:30","date_gmt":"2026-10-06T16:09:30","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113614.html"},"modified":"2026-10-07T00:09:30","modified_gmt":"2026-10-06T16:09:30","slug":"%e5%88%86%e7%a6%bb-express-%e5%ba%94%e7%94%a8%e4%b8%8e%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%9anode-js-%e9%a1%b9%e7%9b%ae%e7%bb%93%e6%9e%84%e4%b8%ad%e7%9a%84-app-server-%e6%8b%86%e5%88%86%e5%ae%9e%e8%b7%b5","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113614.html","title":{"rendered":"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u6587\u6863<\/span><\/li>\n<li><span class=\"gcb-tag\">\u6559\u7a0b<\/span><\/li>\n<li><span class=\"gcb-tag\">\u540e\u7aef<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011nodebestpractices<\/h3>\n<p class=\"gcb-project-desc\">\u2705 The Node.js best practices list (July 2026)<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/GitHub_Trending\/no\/nodebestpractices<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<p>\u672c\u7bc7\u6587\u7ae0\u6e90\u81ea nodebestpractices&#xff08;The Node.js best practices list&#xff0c;Node.js \u6700\u4f73\u5b9e\u8df5\u6e05\u5355&#xff09;\u7684&#034;\u9879\u76ee\u7ed3\u6784&#xff08;Project Structure&#xff09;&#034;\u7ae0\u8282\u3002\u8be5\u7ae0\u8282\u7684\u6838\u5fc3\u4e3b\u5f20\u662f&#xff1a;\u628a Express \u7684 \u5e94\u7528\u58f0\u660e&#xff08;app&#xff09; \u4e0e \u670d\u52a1\u5668\u7f51\u7edc\u914d\u7f6e&#xff08;server&#xff09; \u62c6\u5206\u4e3a\u4e24\u4e2a\u6587\u4ef6\u3002\u672c\u6587\u5c06\u5b8c\u6574\u5c55\u5f00\u8fd9\u4e00\u5b9e\u8df5\u7684\u539f\u7406\u3001\u53cc\u8bed\u8a00\u4ee3\u7801\u8303\u5f0f\u3001\u8fdb\u7a0b\u5185\u6d4b\u8bd5\u65b9\u6cd5&#xff0c;\u5e76\u7ed3\u5408\u4ed3\u5e93\u6e90\u7801\u4e0e\u793a\u4f8b&#xff0c;\u8bf4\u660e\u5b83\u5982\u4f55\u63d0\u5347\u53ef\u6d4b\u8bd5\u6027\u3001\u53ef\u90e8\u7f72\u6027\u4e0e\u4ee3\u7801\u6574\u6d01\u5ea6\u3002<\/p>\n<h3>\u4e3a\u4ec0\u4e48\u8981\u628a app \u4e0e server \u5206\u79bb<\/h3>\n<p>\u6700\u65b0\u7248\u672c\u7684 Express \u5e94\u7528\u751f\u6210\u5668\u81ea\u5e26\u4e00\u9879\u503c\u5f97\u4fdd\u7559\u7684\u5b9e\u8df5&#xff1a;API \u7684\u58f0\u660e\u4e0e\u7f51\u7edc\u76f8\u5173\u914d\u7f6e&#xff08;\u7aef\u53e3\u3001\u534f\u8bae\u7b49&#xff09;\u5f7c\u6b64\u5206\u79bb\u3002\u6362\u8a00\u4e4b&#xff0c;\u8d1f\u8d23&#034;\u5e94\u7528\u957f\u4ec0\u4e48\u6837&#034;&#xff08;\u8def\u7531\u3001\u4e2d\u95f4\u4ef6\u3001\u4e1a\u52a1\u903b\u8f91&#xff09;\u7684\u4ee3\u7801&#xff0c;\u4e0e\u8d1f\u8d23&#034;\u5e94\u7528\u5982\u4f55\u76d1\u542c\u7f51\u7edc&#034;&#xff08;\u7aef\u53e3\u53f7\u3001HTTP \u534f\u8bae\u3001\u8fdb\u7a0b\u542f\u52a8&#xff09;\u7684\u4ee3\u7801&#xff0c;\u5e94\u5f53\u653e\u5728\u4e0d\u540c\u7684\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u8fd9\u4e00\u62c6\u5206\u5e26\u6765\u7684\u6838\u5fc3\u6536\u76ca\u6709\u56db\u70b9&#xff1a;<\/p>\n<li>\u8fdb\u7a0b\u5185\u6d4b\u8bd5&#xff08;in-process testing&#xff09;&#xff1a;\u6d4b\u8bd5\u53ef\u4ee5\u76f4\u63a5\u5f15\u7528 app \u6a21\u5757\u800c\u65e0\u9700\u53d1\u8d77\u771f\u5b9e\u7f51\u7edc\u8c03\u7528\u3002\u7531\u4e8e\u7701\u53bb\u4e86\u7aef\u53e3\u7ed1\u5b9a\u3001socket \u901a\u4fe1\u3001\u5e8f\u5217\u5316\/\u53cd\u5e8f\u5217\u5316\u5f00\u9500&#xff0c;\u6d4b\u8bd5\u6267\u884c\u901f\u5ea6\u66f4\u5feb&#xff0c;\u4e5f\u80fd\u7a33\u5b9a\u83b7\u53d6\u4ee3\u7801\u8986\u76d6\u7387\u6307\u6807&#xff1b;<\/li>\n<li>\u7075\u6d3b\u7684\u7f51\u7edc\u90e8\u7f72\u6761\u4ef6&#xff1a;\u540c\u4e00\u4efd API \u4ee3\u7801\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u7f51\u7edc\u73af\u5883\u4e2d\u590d\u7528\u2014\u2014\u672c\u5730\u5f00\u53d1\u7528 3000 \u7aef\u53e3\u3001\u751f\u4ea7\u73af\u5883\u7531\u7f16\u6392\u5e73\u53f0\u6ce8\u5165\u7aef\u53e3\u3001\u6d4b\u8bd5\u73af\u5883\u751a\u81f3\u5b8c\u5168\u4e0d\u76d1\u542c\u7aef\u53e3&#xff0c;\u53ea\u9700\u5728\u542f\u52a8\u5c42\u51b3\u5b9a&#xff1b;<\/li>\n<li>\u66f4\u597d\u7684\u5173\u6ce8\u70b9\u5206\u79bb&#xff08;separation of concerns&#xff09;&#xff1a;\u4e2d\u95f4\u4ef6\u3001\u8def\u7531\u4e0e\u7f51\u7edc\u914d\u7f6e\u4e0d\u518d\u7ea0\u7f20\u5728\u540c\u4e00\u4e2a\u6587\u4ef6\u91cc&#xff1b;<\/li>\n<li>\u66f4\u6e05\u6670\u7684\u4ee3\u7801\u7ed3\u6784&#xff1a;\u6bcf\u4e2a\u6587\u4ef6\u7684\u804c\u8d23\u5355\u4e00&#xff0c;review \u548c\u5b9a\u4f4d\u95ee\u9898\u65f6\u53ea\u9700\u6309\u804c\u8d23\u627e\u6587\u4ef6\u3002<\/li>\n<p>\u4ece\u4ed3\u5e93\u7684\u6587\u6863\u7ec4\u7ec7\u770b&#xff0c;\u8fd9\u4e00\u5b9e\u8df5\u4f4d\u4e8e sections\/projectstructre \u76ee\u5f55\u4e0b&#xff0c;\u4e0e&#034;\u5c06 Express \u4fdd\u6301\u5728\u81ea\u8eab\u8fb9\u754c\u5185&#034;\u7684\u5206\u5c42\u5b9e\u8df5&#xff08;createlayers.md&#xff09;\u540c\u5c5e\u4e00\u4e2a\u4e3b\u9898\u5e8f\u5217&#xff1a;\u540e\u8005\u4ece\u7eb5\u5411\u4e0a\u628a\u7ec4\u4ef6\u5212\u5206\u4e3a entry-points&#xff08;\u5165\u53e3\u5c42&#xff09;\u3001domain&#xff08;\u9886\u57df\u5c42&#xff09;\u3001data-access&#xff08;\u6570\u636e\u8bbf\u95ee\u5c42&#xff09;&#xff0c;\u800c\u672c\u5b9e\u8df5\u4ece\u6a2a\u5411\u4e0a\u5148\u628a&#034;\u5e94\u7528\u672c\u4f53&#034;\u4e0e&#034;\u7f51\u7edc\u5165\u53e3&#034;\u5207\u5272\u5f00\u2014\u2014\u53ef\u4ee5\u770b\u4f5c\u662f\u5206\u5c42\u601d\u60f3\u5728 Express \u9879\u76ee\u91cc\u6700\u8f7b\u91cf\u3001\u6700\u6613\u843d\u5730\u7684\u4e00\u6b65\u3002<\/p>\n<h3>app.js \/ app.ts&#xff1a;\u53ea\u58f0\u660e API&#xff0c;\u4e0d\u76d1\u542c\u7aef\u53e3<\/h3>\n<p>\u6309\u7167\u8be5\u5b9e\u8df5&#xff0c;API \u58f0\u660e\u5e94\u5f53\u4f4d\u4e8e app.js&#xff08;\u6216 TypeScript \u9879\u76ee\u7684 app.ts&#xff09;\u4e2d\u3002\u8fd9\u91cc\u53ea\u505a\u4e09\u4ef6\u4e8b&#xff1a;\u521b\u5efa Express \u5b9e\u4f8b\u3001\u6302\u8f7d\u5168\u5c40\u4e2d\u95f4\u4ef6\u3001\u6302\u8f7d\u8def\u7531\u6a21\u5757&#xff1a;<\/p>\n<p>const app &#061; express();<br \/>\napp.use(bodyParser.json());<br \/>\napp.use(&#039;\/api\/events&#039;, events.API);<br \/>\napp.use(&#039;\/api\/forms&#039;, forms);<\/p>\n<p>\u5173\u952e\u70b9\u662f&#xff1a;\u8fd9\u6bb5\u4ee3\u7801\u6ca1\u6709\u4efb\u4f55 app.listen() \u8c03\u7528\u3002\u6587\u4ef6\u5728\u6a21\u5757\u52a0\u8f7d\u5b8c\u6210\u540e\u5373\u8fd4\u56de\u4e00\u4e2a\u53ef\u88ab\u5176\u4ed6\u6a21\u5757\u5f15\u7528\u7684 app \u5b9e\u4f8b\u3002\u5b83\u65e2\u53ef\u4ee5\u88ab \/bin\/www \u8fd9\u6837\u7684\u542f\u52a8\u5668\u62ff\u53bb\u521b\u5efa\u670d\u52a1\u5668&#xff0c;\u4e5f\u53ef\u4ee5\u88ab\u6d4b\u8bd5\u6846\u67b6\u76f4\u63a5\u62ff\u53bb\u53d1\u8d77\u8fdb\u7a0b\u5185\u8bf7\u6c42\u2014\u2014\u8fd9\u6b63\u662f\u540e\u9762&#034;\u8fdb\u7a0b\u5185\u6d4b\u8bd5&#034;\u80fd\u591f\u6210\u7acb\u7684\u524d\u63d0\u3002<\/p>\n<p>\u4ece\u4ed3\u5e93\u793a\u4f8b\u770b&#xff0c;sections\/examples\/dockerfile\/src\/app.ts \u4e2d\u7684\u6700\u5c0f Express \u5e94\u7528\u91c7\u7528\u4e86\u540c\u4e00\u5f62\u6001&#xff1a;\u5148 import * as express from &#039;express&#039; \u5e76\u521b\u5efa const app &#061; express()&#xff0c;\u518d\u5b9a\u4e49\u8def\u7531\u5904\u7406\u5668\u3002\u867d\u7136\u8be5\u793a\u4f8b\u4e3a\u4e86\u6f14\u793a\u7684\u7b80\u6d01\u6027\u76f4\u63a5\u8c03\u7528\u4e86 app.listen(3000)&#xff08;\u5c06\u5176\u4f5c\u4e3a Docker \u6f14\u793a\u5165\u53e3&#xff09;&#xff0c;\u4f46\u5728\u6b63\u5f0f\u9879\u76ee\u4e2d&#xff0c;\u8fd9\u6b63\u662f\u5e94\u5f53\u88ab\u62c6\u5206\u51fa\u53bb\u7684\u90a3\u4e00\u884c\u2014\u2014\u628a&#034;\u521b\u5efa\u5e94\u7528&#034;\u4e0e&#034;\u542f\u52a8\u76d1\u542c&#034;\u4ece\u540c\u4e00\u4e2a\u6587\u4ef6\u91cc\u5265\u79bb\u5f00\u6765\u3002<\/p>\n<h3>\/bin\/www&#xff1a;\u670d\u52a1\u5668\u7f51\u7edc\u58f0\u660e\u7684\u552f\u4e00\u5f52\u5c5e<\/h3>\n<p>\u7f51\u7edc\u5c42\u7684\u58f0\u660e\u5e94\u5f53\u4f4d\u4e8e \/bin\/www&#xff08;Express \u751f\u6210\u5668\u7ea6\u5b9a\u7684\u542f\u52a8\u5668\u6587\u4ef6\u4f4d\u7f6e&#xff09;\u3002\u5b83\u7684\u804c\u8d23\u662f&#xff1a;\u4ece\u73af\u5883\u53d8\u91cf\u8bfb\u53d6\u7aef\u53e3\u3001\u628a\u7aef\u53e3\u5199\u5165 Express\u3001\u521b\u5efa HTTP \u670d\u52a1\u5668&#xff1a;<\/p>\n<p>const app &#061; require(&#039;..\/app&#039;);<br \/>\nconst http &#061; require(&#039;http&#039;);<\/p>\n<p>\/\/ Get port from environment and store in Express.<br \/>\nconst port &#061; normalizePort(process.env.PORT || &#039;3000&#039;);<br \/>\napp.set(&#039;port&#039;, port);<\/p>\n<p>\/\/ Create HTTP server.<br \/>\nconst server &#061; http.createServer(app);<\/p>\n<p>\u5bf9\u5e94 TypeScript \u7248\u672c&#xff1a;<\/p>\n<p>import app from &#039;..\/app&#039;;<br \/>\nimport http from &#039;http&#039;;<\/p>\n<p>\/\/ Get port from environment and store in Express.<br \/>\nconst port &#061; normalizePort(process.env.PORT || &#039;3000&#039;);<br \/>\napp.set(&#039;port&#039;, port);<\/p>\n<p>\/\/ Create HTTP server.<br \/>\nconst server &#061; http.createServer(app);<\/p>\n<p>\u8fd9\u91cc\u6709\u4e09\u4e2a\u503c\u5f97\u6ce8\u610f\u7684\u5b9e\u73b0\u7ec6\u8282&#xff1a;<\/p>\n<ul>\n<li>normalizePort&#xff1a;\u8fd9\u662f Express \u751f\u6210\u5668\u81ea\u5e26\u7684\u5de5\u5177\u51fd\u6570&#xff0c;\u8d1f\u8d23\u628a\u7aef\u53e3\u503c\u89c4\u8303\u5316\u4e3a\u5408\u6cd5\u6570\u5b57\u3001\u5177\u540d\u7ba1\u9053\u6216 false&#xff08;\u8868\u793a\u7aef\u53e3\u65e0\u6548&#xff09;&#xff0c;\u786e\u4fdd\u540e\u7eed server.listen() \u62ff\u5230\u7684\u662f\u5b89\u5168\u53ef\u7528\u7684\u7aef\u53e3\u503c&#xff1b;<\/li>\n<li>process.env.PORT || &#039;3000&#039;&#xff1a;\u7aef\u53e3\u4f18\u5148\u4ece\u73af\u5883\u53d8\u91cf\u6ce8\u5165&#xff0c;\u7f3a\u7701\u56de\u9000\u5230 3000\u3002\u8fd9\u8ba9\u540c\u4e00\u4e2a API \u5728\u672c\u5730\u3001CI\u3001\u5bb9\u5668\u548c\u96c6\u7fa4\u73af\u5883\u4e2d\u90fd\u53ef\u4ee5\u590d\u7528\u2014\u2014\u5bb9\u5668\u5e73\u53f0\u53ea\u9700\u6ce8\u5165 PORT \u73af\u5883\u53d8\u91cf\u5373\u53ef\u6539\u53d8\u76d1\u542c\u7aef\u53e3&#xff0c;\u65e0\u9700\u6539\u52a8\u4efb\u4f55\u4ee3\u7801&#xff1b;<\/li>\n<li>http.createServer(app)&#xff1a;\u628a Express \u5e94\u7528\u5b9e\u4f8b\u4f5c\u4e3a\u8bf7\u6c42\u5904\u7406\u56de\u8c03\u4ea4\u7ed9 Node \u539f\u751f HTTP \u670d\u52a1\u5668\u3002\u8fd9\u610f\u5473\u7740\u534f\u8bae\u5c42&#xff08;HTTP\/HTTPS\/HTTP2&#xff09;\u7684\u5207\u6362\u53d1\u751f\u5728 \/bin\/www \u8fd9\u4e00\u5c42&#xff0c;app \u6a21\u5757\u672c\u8eab\u5b8c\u5168\u4e0d\u611f\u77e5\u7f51\u7edc\u534f\u8bae\u7ec6\u8282\u3002\u8fd9\u4e5f\u5370\u8bc1\u4e86\u5206\u5c42\u6587\u6863 createlayers.md \u4e2d\u7684\u8bba\u65ad&#xff1a;\u5f53\u9886\u57df\/\u5e94\u7528\u5c42\u4e0d\u611f\u77e5\u4efb\u4f55\u8fb9\u7f18\u534f\u8bae\u65f6&#xff0c;\u5b83\u5c31\u80fd\u670d\u52a1\u4e8e\u4efb\u610f\u5ba2\u6237\u7aef&#xff0c;\u800c\u4e0d\u53ea\u662f HTTP \u8c03\u7528\u3002<\/li>\n<\/ul>\n<h3>\u8fdb\u7a0b\u5185\u6d4b\u8bd5&#xff1a;\u7528 supertest \u5728\u4e0d\u542f\u52a8\u7f51\u7edc\u7684\u60c5\u51b5\u4e0b\u9a8c\u8bc1 API<\/h3>\n<p>\u5206\u79bb app \u4e0e server \u6700\u76f4\u63a5\u7684\u6536\u76ca\u4f53\u73b0\u5728\u6d4b\u8bd5\u73af\u8282\u3002supertest&#xff08;\u539f\u6587\u6863\u79f0\u4e4b\u4e3a&#034;\u6d41\u884c\u7684\u6d4b\u8bd5\u5305&#034;&#xff09;\u5141\u8bb8\u76f4\u63a5\u628a Express \u5e94\u7528\u5b9e\u4f8b\u4f20\u5165\u5e76\u53d1\u8d77 HTTP \u98ce\u683c\u7684\u8bf7\u6c42\u65ad\u8a00&#xff0c;\u5168\u7a0b\u4e0d\u7ed1\u5b9a\u7aef\u53e3\u3001\u4e0d\u505a\u771f\u5b9e\u7f51\u7edc\u8c03\u7528&#xff1a;<\/p>\n<p>const app &#061; express();<\/p>\n<p>app.get(&#039;\/user&#039;, (req, res) &#061;&gt; {<br \/>\n  res.status(200).json({ name: &#039;tobi&#039; });<br \/>\n});<\/p>\n<p>request(app)<br \/>\n  .get(&#039;\/user&#039;)<br \/>\n  .expect(&#039;Content-Type&#039;, \/json\/)<br \/>\n  .expect(&#039;Content-Length&#039;, &#039;15&#039;)<br \/>\n  .expect(200)<br \/>\n  .end((err, res) &#061;&gt; {<br \/>\n    if (err) throw err;<br \/>\n  });<\/p>\n<p>TypeScript \u7248\u672c&#xff08;\u5e26\u7c7b\u578b\u6807\u6ce8&#xff09;&#xff1a;<\/p>\n<p>const app &#061; express();<\/p>\n<p>app.get(&#039;\/user&#039;, (req: Request, res: Response) &#061;&gt; {<br \/>\n  res.status(200).json({ name: &#039;tobi&#039; });<br \/>\n});<\/p>\n<p>request(app)<br \/>\n  .get(&#039;\/user&#039;)<br \/>\n  .expect(&#039;Content-Type&#039;, \/json\/)<br \/>\n  .expect(&#039;Content-Length&#039;, &#039;15&#039;)<br \/>\n  .expect(200)<br \/>\n  .end((err: Error) &#061;&gt; {<br \/>\n    if (err) throw err;<br \/>\n  });<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u6f14\u793a\u4e86 supertest \u7684\u6838\u5fc3\u7528\u6cd5&#xff1a;request(app) \u76f4\u63a5\u63a5\u6536 app \u5b9e\u4f8b&#xff1b;.get(&#039;\/user&#039;) \u6307\u5b9a\u65b9\u6cd5\u4e0e\u8def\u5f84&#xff1b;\u94fe\u5f0f .expect(&#8230;) \u53ef\u4ee5\u540c\u65f6\u65ad\u8a00\u54cd\u5e94\u5934&#xff08;Content-Type\u3001Content-Length&#xff09;\u4e0e\u72b6\u6001\u7801&#xff08;200&#xff09;&#xff1b;\u6700\u540e .end(callback) \u6536\u5c3e&#xff0c;\u56de\u8c03\u4e2d\u629b\u51fa\u4efb\u4f55\u65ad\u8a00\u9519\u8bef\u3002<\/p>\n<p>\u8fd9\u79cd\u6d4b\u8bd5\u65b9\u5f0f\u7684\u4f18\u52bf\u4e0e\u6587\u4ef6\u62c6\u5206\u76f4\u63a5\u76f8\u5173&#xff1a;\u6d4b\u8bd5\u53ea\u9700 require(&#039;..\/app&#039;)&#xff08;\u6216 import app from &#039;..\/app&#039;&#xff09;\u5c31\u80fd\u62ff\u5230\u5b8c\u6574\u7684\u5e94\u7528\u5b9e\u4f8b&#xff0c;\u800c \/bin\/www \u91cc\u7684\u7aef\u53e3\u903b\u8f91\u88ab\u5b8c\u5168\u65c1\u8def\u2014\u2014\u4e0d\u9700\u8981\u5173\u5fc3\u7aef\u53e3\u662f\u5426\u88ab\u5360\u7528\u3001\u4e0d\u9700\u8981\u7b49\u670d\u52a1\u5668\u5c31\u7eea\u3001\u4e0d\u4ea7\u751f\u989d\u5916\u7684\u7f51\u7edc\u5f00\u9500\u3002\u914d\u5408 sections\/testingandquality \u76ee\u5f55\u4e0b\u7684\u6d4b\u8bd5\u6700\u4f73\u5b9e\u8df5&#xff08;\u5982 AAA \u6a21\u5f0f aaa.md\u3001\u6d4b\u8bd5\u547d\u540d\u4e09\u6bb5\u5f0f 3-parts-in-name.md\u3001\u4e2d\u95f4\u4ef6\u6d4b\u8bd5 test-middlewares.md&#xff09;&#xff0c;\u53ef\u4ee5\u6784\u5efa\u51fa\u53c8\u5feb\u53c8\u7a33\u7684 API \u6d4b\u8bd5\u5957\u4ef6\u3002<\/p>\n<h3>\u4e0e\u5bb9\u5668\u5316\u90e8\u7f72\u7684\u914d\u5408<\/h3>\n<p>app\/server \u62c6\u5206\u5728\u5bb9\u5668\u5316\u573a\u666f\u4e2d\u540c\u6837\u9002\u7528\u3002\u4ed3\u5e93\u7684 Docker \u793a\u4f8b \u5c55\u793a\u4e86\u8fd9\u4e00\u70b9&#xff1a;Dockerfile \u7684\u6784\u5efa\u9636\u6bb5\u5148\u6267\u884c npm ci&#xff08;\u4ee5 lockfile \u4e3a\u51c6&#xff09;\u518d npm run build&#xff0c;\u8fd0\u884c\u9636\u6bb5\u5219\u901a\u8fc7<\/p>\n<p>CMD [ &#034;node&#034;, &#034;dist\/app.js&#034; ]<\/p>\n<p>\u542f\u52a8\u6784\u5efa\u4ea7\u7269&#xff08;\u89c1 Dockerfile&#xff0c;\u5bf9\u5e94 package.json \u4e2d\u7684 build: tsc &#8211;outDir dist &#8230; \u811a\u672c&#xff09;\u3002\u5bb9\u5668\u542f\u52a8\u547d\u4ee4\u6307\u5411\u7684\u6b63\u662f\u5e94\u7528\u5165\u53e3\u6587\u4ef6\u2014\u2014\u8fd9\u4e0e&#034;\u5e94\u7528\u6a21\u5757&#xff08;app&#xff09;\u4e0e\u8fdb\u7a0b\u542f\u52a8&#xff08;entry&#xff09;\u5206\u79bb&#034;\u7684\u601d\u8def\u4e00\u8109\u76f8\u627f&#xff1a;\u955c\u50cf\u5185\u90e8\u901a\u8fc7 EXPOSE 3000 \u58f0\u660e\u7aef\u53e3&#xff0c;\u5b9e\u9645\u7aef\u53e3\u5728\u8fd0\u884c\u65f6\u7531 PORT \u73af\u5883\u53d8\u91cf\u6ce8\u5165&#xff0c;\u5e94\u7528\u4ee3\u7801\u672c\u8eab\u4e0d\u786c\u7f16\u7801\u76d1\u542c\u7aef\u53e3\u3002\u8fd9\u4e5f\u547c\u5e94\u4e86\u4ed3\u5e93 Docker \u7ae0\u8282\u4e2d\u5173\u4e8e\u751f\u4ea7\u955c\u50cf\u3001\u591a\u9636\u6bb5\u6784\u5efa\u7684\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<h3>\u843d\u5730\u5efa\u8bae&#xff1a;\u4ece\u62c6\u5206\u5230\u5206\u5c42<\/h3>\n<p>\u7efc\u5408\u672c\u8282\u6587\u6863&#xff08;separateexpress.chinese.md \u4e0e\u82f1\u6587\u539f\u7248 separateexpress.md \u540c\u5c5e\u8be5\u4e3b\u9898&#xff09;\u53ca createlayers.md \u7684\u8bba\u8ff0&#xff0c;\u843d\u5730\u65f6\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u9012\u8fdb\u5f0f\u6b65\u9aa4&#xff1a;<\/p>\n<li>\u7b2c\u4e00\u6b65&#xff08;\u672c\u5b9e\u8df5&#xff09;&#xff1a;\u628a app.listen(&#8230;) \u4ece app \u6a21\u5757\u4e2d\u79fb\u9664&#xff0c;\u5c06\u7aef\u53e3\u4e0e\u670d\u52a1\u5668\u521b\u5efa\u903b\u8f91\u8fc1\u5165 \/bin\/www \u4e4b\u7c7b\u7684\u542f\u52a8\u5668\u6587\u4ef6&#xff0c;app \u6a21\u5757\u4ec5\u4fdd\u7559\u5b9e\u4f8b\u521b\u5efa\u3001\u4e2d\u95f4\u4ef6\u4e0e\u8def\u7531\u6302\u8f7d&#xff1b;<\/li>\n<li>\u7b2c\u4e8c\u6b65&#xff1a;\u628a\u542f\u52a8\u5668\u4e0e\u4e1a\u52a1\u6a21\u5757\u8fdb\u4e00\u6b65\u89e3\u8026&#xff0c;\u8ba9 app.js \u6210\u4e3a\u4e00\u4e2a\u7eaf\u5bfc\u51fa\u6a21\u5757&#xff0c;\u4fbf\u4e8e\u6d4b\u8bd5\u4e0e\u590d\u7528&#xff1b;<\/li>\n<li>\u7b2c\u4e09\u6b65&#xff08;\u8fdb\u9636&#xff09;&#xff1a;\u53c2\u8003\u5206\u5c42\u5b9e\u8df5&#xff0c;\u5728\u7ec4\u4ef6\u5185\u90e8\u6309 entry-points&#xff08;\u5165\u53e3\/\u63a7\u5236\u5668&#xff09;\u2192 domain&#xff08;\u9886\u57df\/\u4e1a\u52a1&#xff09;\u2192 data-access&#xff08;\u6570\u636e\u8bbf\u95ee&#xff09;\u4e09\u4e2a\u5c42\u6b21\u7ec4\u7ec7\u4ee3\u7801&#xff0c;\u8ba9 Express \u5f7b\u5e95\u4fdd\u6301\u5728\u8fb9\u754c\u4e4b\u5185\u2014\u2014\u5165\u53e3\u5c42\u8d1f\u8d23\u9002\u914d\u8bf7\u6c42\u4e0e\u54cd\u5e94&#xff0c;\u9886\u57df\u5c42\u53ea\u63a5\u6536\u534f\u8bae\u65e0\u5173\u7684\u666e\u901a JavaScript \u5bf9\u8c61&#xff0c;\u6570\u636e\u8bbf\u95ee\u5c42\u8d1f\u8d23\u4e0e\u6570\u636e\u5e93\u4ea4\u4e92\u3002<\/li>\n<p>\u5b8c\u6210\u8fd9\u4e09\u6b65\u540e&#xff0c;\u9879\u76ee\u5c06\u83b7\u5f97&#xff1a;\u6beb\u79d2\u7ea7\u7684\u8fdb\u7a0b\u5185\u6d4b\u8bd5\u3001\u53ef\u79fb\u690d\u7684\u7f51\u7edc\u90e8\u7f72\u3001\u6e05\u6670\u7684\u804c\u8d23\u8fb9\u754c\u2014\u2014\u8fd9\u6b63\u662f Node.js \u9879\u76ee\u7ed3\u6784\u6700\u4f73\u5b9e\u8df5\u5e0c\u671b\u8fbe\u6210\u7684\u6700\u7ec8\u72b6\u6001\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261006160929-6ac51d39ae9fe.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u6587\u6863<\/span><\/li>\n<li><span class=\"gcb-tag\">\u6559\u7a0b<\/span><\/li>\n<li><span class=\"gcb-tag\">\u540e\u7aef<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011nodebestpractices<\/h3>\n<p class=\"gcb-project-desc\">\u2705 The Node.js best practices list (July 2026)<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/GitHub_Trending\/no\/nodebestpractices<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Node.js Best Practices \u5b9e\u6218&#xff1a;\u5728 Express \u4e2d\u5206\u79bb app \u4e0e server&#xff08;\u9879\u76ee\u67b6\u6784\u5b9e\u8df5&#xff09;<\/h5>\n<p class=\"gcb-related-item-desc\">Node.js Best Practices \u5b9e\u6218&#xff1a;\u5728 Express \u4e2d\u5206\u79bb app \u4e0e server&#xff08;\u9879\u76ee\u67b6\u6784\u5b9e\u8df5&#xff09; \u672c\u6307\u5357\u57fa\u4e8e nodebestpract<\/p>\n<p>     <span class=\"gcb-tag\">\u6587\u6863<\/span><br \/>\n     <span class=\"gcb-tag\">\u6559\u7a0b<\/span><br \/>\n     <span class=\"gcb-tag\">\u540e\u7aef<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">\u5728 Raspberry Pi \u4e0a\u4f7f\u7528 Grove VL53L0X \u98de\u884c\u65f6\u95f4\u8ddd\u79bb\u4f20\u611f\u5668\u5b9e\u73b0\u6c34\u679c\u8d28\u68c0\u89e6\u53d1&#xff08;IoT-For-Beginners \u5236\u9020\u9879\u76ee\u5b9e\u6218&#xff09;<\/h5>\n<p class=\"gcb-related-item-desc\">\u5728 Raspberry Pi \u4e0a\u4f7f\u7528 Grove VL53L0X \u98de\u884c\u65f6\u95f4\u8ddd\u79bb\u4f20\u611f\u5668\u5b9e\u73b0\u6c34\u679c\u8d28\u68c0\u89e6\u53d1&#xff08;IoT For Beginners \u5236\u9020\u9879\u76ee\u5b9e\u6218&#xff09; \u672c\u6307\u5357<\/p>\n<p>     <span class=\"gcb-tag\">\u6587\u6863<\/span><br \/>\n     <span class=\"gcb-tag\">\u6559\u7a0b<\/span><br \/>\n     <span class=\"gcb-tag\">\u540e\u7aef<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">\u5206\u79bb Express \u7684 app \u4e0e server&#xff1a;Node.js \u9879\u76ee\u7ed3\u6784\u4e2d API \u58f0\u660e\u4e0e\u7f51\u7edc\u914d\u7f6e\u89e3\u8026\u7684\u5de5\u7a0b\u5b9e\u8df5<\/h5>\n<p class=\"gcb-related-item-desc\">\u5206\u79bb Express \u7684 app \u4e0e server&#xff1a;Node.js \u9879\u76ee\u7ed3\u6784\u4e2d API \u58f0\u660e\u4e0e\u7f51\u7edc\u914d\u7f6e\u89e3\u8026\u7684\u5de5\u7a0b\u5b9e\u8df5 \u5bfc\u8bfb \u5728 Node.js \u670d\u52a1\u7aef\u9879\u76ee\u4e2d&#xff0c;\u5982<\/p>\n<p>     <span class=\"gcb-tag\">\u6587\u6863<\/span><br \/>\n     <span class=\"gcb-tag\">\u6559\u7a0b<\/span><br \/>\n     <span class=\"gcb-tag\">\u540e\u7aef<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  IPTVnator \u5b98\u7f51\u535a\u5ba2\u5c01\u9762\u8bbe\u8ba1&#xff1a;\u4e00\u5f20\u201c\u5b98\u65b9\u4fe1\u53f7\u201d\u63d2\u753b\u5982\u4f55\u8d2f\u901a Astro \u5185\u5bb9\u96c6\u5408\u4e0e Open Graph \u5143\u6570\u636e <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n   BetterNCM\u5b8c\u6574\u5b89\u88c5\u6307\u5357&#xff1a;3\u5206\u949f\u641e\u5b9a\u7f51\u6613\u4e91\u63d2\u4ef6\u7ba1\u7406\u7ec8\u6781\u65b9\u6848 <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u6863\u6559\u7a0b\u540e\u7aef \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011nodebestpractices \u2705 The Node.js best practices list (July 2026) \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/GitHub_Trending\/no\/nodebestpractices \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d  \u672c\u7bc7\u6587\u7ae0\u6e90\u81ea nodebestpractices&#xff08;The Node.js best practices list&#xff0c;Node.js \u6700<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-113614","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/113614.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u6863\u6559\u7a0b\u540e\u7aef \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011nodebestpractices \u2705 The Node.js best practices list (July 2026) \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/GitHub_Trending\/no\/nodebestpractices \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u672c\u7bc7\u6587\u7ae0\u6e90\u81ea nodebestpractices&#xff08;The Node.js best practices list&#xff0c;Node.js \u6700\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113614.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-06T16:09:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261006160929-6ac51d39ae9fe.svg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113614.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113614.html\",\"name\":\"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-06T16:09:30+00:00\",\"dateModified\":\"2026-10-06T16:09:30+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113614.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113614.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113614.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/113614.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u6863\u6559\u7a0b\u540e\u7aef \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011nodebestpractices \u2705 The Node.js best practices list (July 2026) \u9879\u76ee\u5730\u5740&#xff1a; https:\/\/gitcode.com\/GitHub_Trending\/no\/nodebestpractices \u70b9\u51fb\u67e5\u770b \u514d\u8d39\u4e0b\u8f7d \u672c\u7bc7\u6587\u7ae0\u6e90\u81ea nodebestpractices&#xff08;The Node.js best practices list&#xff0c;Node.js \u6700","og_url":"https:\/\/www.wsisp.com\/helps\/113614.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-06T16:09:30+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261006160929-6ac51d39ae9fe.svg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113614.html","url":"https:\/\/www.wsisp.com\/helps\/113614.html","name":"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-06T16:09:30+00:00","dateModified":"2026-10-06T16:09:30+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113614.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113614.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113614.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5206\u79bb Express \u5e94\u7528\u4e0e\u670d\u52a1\u5668\uff1aNode.js \u9879\u76ee\u7ed3\u6784\u4e2d\u7684 app\/server \u62c6\u5206\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=113614"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113614\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113614"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}