Meteor第一個應用程式


這一個小教學將教你如何建立你的第一個 Meteor 應用程式。

步驟 1 - 建立App

要建立應用程式,我們將從命令提示字元視窗執行 meteor create 命令。該應用程式的名稱是 meteorApp

C:\Users\Administrator\Desktop\Meteor>meteor create meteorApp
這將會建立一個名為 meteorApp 的 Meteor 應用程式所產生的檔案和新檔案夾如下結構所示:
client/main.js # a JavaScript entry point loaded on the client client/main.html # an HTML file that defines view templates client/main.css # a CSS file to define your app's styles server/main.js # a JavaScript entry point loaded on the server package.json # a control file for installing NPM packages .meteor # internal Meteor files .gitignore # a control file for git

步驟 2 - 執行App

我們可以通過鍵入 meteor 命令執行應用程式。
C:\Users\Administrator\Desktop\Meteor\meteorApp>meteor
此命令將啟動多個進程。你可以從下面的影象中看到。

步驟3 - 驗證結果

現在,可以開啟URL地址:http://localhost:3000/,看你的第一個 Meteor 應用程式執行的樣子。