![](/img/trans.png)
[英]What does "/*" mean in node / express app.get("/*)
[英]What does the forward slash mean in app.get('/',function(){…}); in express.js?
我剛剛開始學習express.js,在那我們做app.get('/'。function(){...});,我想知道那是什么意思。我試圖研究Google,但實際上無法獲得,而不會過於技術化就可以簡單地描述它。
假設您在本地主機端口8080上運行服務器。那么服務器的根 URL是http:// localhost:8080 。
因此,當你寫
app.get('/', function(request, response) {
console.log('hi');
})
你是說
當有人將HTTP GET發送到http:// localhost:8080時 ,我將“ hi”登錄到控制台。
/
表示您的根網址
/example
相反,則表示http:// localhost:8080 / example function(){}
是您想做的回應
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.