跳到主要內容

[教學] Mojito 安裝與入門,install mojito for beginner.

mojito,最近終於從 YDN 對外公開此專案,這個套件主要用於解決前端多重裝置及瀏覽器端的問題,後端服務採取 node.js ,因此使用上必定要先準備以下幾個元素

準備素材

  • c++ complier
  • git
  • Node.js > 0.4.x
  • NPM > 1.0.x

安裝方式

git clone git://github.com/yahoo/mojito.git
cd mojito/source
sudo npm install -g .
npm install .
以上四個簡單的步驟,就可以把 mojito module 完整安裝到服務器上,接著就可以開始進入 mojito 的世界

使用方式

mojito 提供了完整的 command line 給開發者使用,接著先建立一個基本 hello world 專案,跟著以下步驟完成第一個專案。首先建立一個 mojito application,
mojito create app hello
cd hello
切換到目錄之後,再接著建立自己的 mojit,這邊的 mojit 就像是一個應用(application)可能會包含許多個獨立網站體,擁有獨立架構的 MVC ,包含內部設定等,詳細資料可以參考官方的說明,建立 mojit
mojito create mojit HelloMojit
輸入指令後,會看到顯示結果如下,
creating mojit called 'HelloMojit'
(using "default" archetype)
✔ mojit: HelloMojit created!
✔ mojito done.   
接著修改 application.json 這個 mojit 設定檔案,讓剛才新建立的 hellp application 指定底下有一個 mojit -> HelloMojit ,讓應用可以去執行 mojit controller ,修改如下,
[
  {
    "settings": [ "master" ],
    "appPort": 8666,
    "specs": {
      "hello": {
        "type": "HelloMojit"
      }
    }
  }
]
再修改 route.json ,指定應用的路徑會執行哪一個 controller ,修改如下,
[
  {
    "settings": [ "master" ],
    "hello index": {
      "verbs": ["get"],
      "path": "/",
      "call": "hello.index"
    }
  }
]

啟動 mojito 服務器

最後啟動 mojito 服務器,
mojito start
開啟瀏覽器,檢查是否執行正確
http://localhost:8666/
會顯示結果如下,
status
    Mojito is working.
data
    some: data    
恭喜,完成了第一個 mojito 應用程式。

後記

Yahoo 這次公開的 mojito 專案,是目前看起來架構、文件都是最完整的,同時也有提到可以透過 mojito 建構出多種不同裝置適用的 web app,同時裡面包含了 jslint, js compressor, l10n 等讓開發者可以透過 mojito 滿足許多需求,當然 mojito 也是可以融合 YUI 使用。
Node.JS 發展至今,加上其他開發者的投入,已經讓 JavaScript 這個語言在 web 有了不同的角色,橫跨前後端服務。

工商服務

體會 JavaScript 的優點、美好,歡迎關注 JSDC,台灣 JavaScript 盛會即將展開!


留言

  1. Howdy! Someeone іnn my Myspace group shared this site with us so
    I came to give it a looκ. I'm definitely enjoying the
    information. I'm book-marking aոd will bbe tweeting hіs to my followers!
    Great blog and wonderful stylee and design.

    My blog post; best Baby monitors uk 2012

    回覆刪除
  2. Back to year 2010, we may have experienced some
    of our friends being layoff by the company and jobless to get a period of time.
    However, you must be careful when using such codes.
    After returning recently from Portabelo, Panama where the renowned pirater
    expert and adventurer had the opportunity to dive on
    and study several shipwrecks involved in Sir Francis Drake's burial at sea, (
    Croce will speak about his adventures and the journeys of the pirates of St.

    com friends inbox me that she what food was in typically the U.
    Once you have look at this article you will not have to deal with
    your traffic worries anymore. I believe that it can be done without the
    check, if you keep talking to the two of them.
    Among the most common methods are stealing passwords, email hacking and
    phishing.

    my webpage - pirater facebook gratuitement 2014 - facebook decryptor

    回覆刪除
  3. WOW just what I was searching for. Came here by searching for

    Also visit my webpage: bistro md diet

    回覆刪除
  4. Speaking tom is now available via Intel Appup, which make every thing simple and hassle totally free to get it.
    Here are the steps used to get talking tom to Computer.
    The query is, do carriers lose cash on these offers.

    Feel free to visit my webpage - kik setup for pc (http://testdrivinglife.blogspot.nl/)

    回覆刪除
  5. Very good article! We are linking to this particularly great content
    on our website. Keep up the good writing.

    Look into my blog post :: Meska-apteka.pl

    回覆刪除
  6. I am really grateful to the holder of this weeb site who has shared this enormous piece of writing at at this time.


    Review my blog what is tinnitus a symptom of

    回覆刪除
  7. Why viewers still mae use of to read news papers when inn this technological globe all iis existing on net?


    mypage - marketing

    回覆刪除
  8. I read this article fully concerning the difference of most recent and earlier
    technologies, it's remarkable article.

    my web page plumber snake Avondale

    回覆刪除
  9. Hi there, just became alert to your blog through Google, and found that it is truly
    informative. I am going to watch out for brussels.
    I will be grateful if you continue this in future.

    Many people will be benefited from your writing. Cheers!



    Feel free to visit my blog; http://www.ashrafit.Com

    回覆刪除
  10. Thank you for every other fantastic post. Where else could anybody get that type of info in such
    an ideal means of writing? I have a presentation subsequent week, and
    I'm at the look for such information.

    My homepage; meal plans for weight loss

    回覆刪除
  11. Justin Bieber Kisses Selena Gomez at 2011 MTV VMAs. Mobile Holidays Examiner is interesting while sharing traditional
    and bizarre holidays, food holidays along with history and trivia about fun holidays throughout the year.
    He is the man behind Girls Gone Wild, and Kim is
    at his home for the second time this summer.


    Here is my web blog :: Kim Kardashian Hollywood
    Hack - kimkardashianhollywoodhack.com -

    回覆刪除

張貼留言

這個網誌中的熱門文章

Vibe Coding:到底?氛圍驅動程式開發必殺技?

Vibe Coding(氛圍編程) 是由 OpenAI 共同創辦人 Andrej Karpathy 在 2025 年提出的革命性程式開發方式,它讓開發者透過自然語言與 AI 對話來生成程式碼,徹底改變了傳統的編程模式。 這種開發方式的核心理念是 「順著感覺走」 ,讓 AI 處理技術細節,開發者專注於創意和需求描述。 Vibe Coding 需要基本上的規劃和執行,但並沒有強制規範,從日常經驗來說可分為三個階段, 前期準備、開發過程、和後期維護 三個關鍵階段。每個階段都有其特定的任務和注意事項,正確執行這些步驟將大幅提升開發效率和程式品質。 將靈感與需求透過 AI 快速轉化成產品功能或原型。以下幫你分成 「前、中、後」 三階段要做的事情,適合你自己做、或帶團隊做 前期:設定 vibe & 準備素材 這個階段的重點是 「建立開發語境」 ,因為 AI 的生成表現高度依賴前期提供的上下文與資料。 明確目標 :釐清要解決的問題、預期要做的功能與核心價值。例如在筆記軟體的情境中,可能是:「我要做一款讓使用者能用 Markdown 記錄筆記,並提供標籤與全文搜尋功能的簡單 App。」 收集靈感 :觀察同類產品(如 Obsidian、Notion)、蒐集市場痛點(例如太多筆記軟體無法脫機使用,或同步效能差)。 建立語境 :準備初步 prompt、背景知識、產品定位、品牌調性、目標使用者輪廓等。 確認資源 :決定用哪些工具(Gemini、ChatGPT、設計軟體、流程管理工具等)。 確認完上述內容之後,就可以先開始進行準備規格,進行第一次的 Vibe Coding 方向驗證 提示詞模板準備 很多人會跳過這步驟,但一份 「好的 AI 提示詞模板」 將決定接下來每一次 AI 對話的品質。有效的提示詞模板需具備: 描述具體且無歧義 包含技術要求和約束條件 提供範例資料和測試案例 指定程式碼風格和慣例 例如針對筆記軟體的案例:   「建立一個支援 AI 功能純文字筆記,輸入內容可即時渲染;需支援儲存到本地檔案,提供標籤欄位做分類;以 React 架構,程式風格採用 Tailwind style components 並使用 hooks。」 開發工具選擇 開發工具的選擇 同樣重要,目前市場上主要的 ...

Claude Code Hooks:自動化與安全的最佳實踐

寫在最前頭,這份文章主要寫起來是給自己看, 同時內容是比較適合開發者,工程師們可以做些自動化處理的簡單筆記。 Claude Code hooks Claude Code hooks 是一種強大的自動化機制,允許用戶在 Claude Code 的不同生命週期階段,自定義執行 shell 指令。這種設計讓開發者能夠將規則和自動化行為嵌入到應用層級,確保每次都能可靠執行,而不必依賴 LLM(大型語言模型)是否會選擇執行某項操作。 Hooks 的核心用途 通知 :自訂收到 Claude Code 等待用戶輸入或執行權限時的提醒方式。 自動格式化 :如在每次檔案編輯後自動執行 prettier (針對 .ts 檔)、 gofmt (針對 .go 檔)等。 日誌記錄 :追蹤所有執行過的命令,便於合規或除錯。 自動反饋 :當 Claude Code 產生不符合團隊規範的程式碼時,自動給出反饋。 自訂權限 :阻擋對生產環境檔案或敏感目錄的修改[^1]。 配置與結構 Hooks 透過設定檔進行配置,分為全域( ~/.claude/settings.json )、專案( .claude/settings.json )、本地專案( .claude/settings.local.json )以及企業級策略設定。每個 hook 由「事件名稱」和「匹配器」組成: "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "jq -r '...'" } ] } ] } matcher :用於匹配工具名稱(支援正則表達式),如 Write 、 Edit|Write 、 Notebook.* 。 hooks :當匹配時要執行的命令陣列。 type :目前僅支援 "command" 。 ...

[CSS] z-index 在不同瀏覽器繼承問題

今天會討論到這個課題,是因為要實做一個Popup dialog,所以我們希望的結果如下圖。 可是在IE7 卻發生了這樣的情況。 Popup不論怎麼設定z-index都無法浮在最上層,我們看一下html架構發生什麼事情。