跳到主要內容

[教學] 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 -

    回覆刪除

張貼留言

這個網誌中的熱門文章

RAG 和 Prompt 原理超簡單解說!想知道 AI 怎麼找答案看這篇

這篇文章是給對於你已經開始使用所謂的 ChatGPT / Claude / Gemini 之類的 AI 服務,甚至是 Siri (嘿丟,他也是一種 AI 應用服務喔) 簡單來說是非 技術人員, PM,小白,想要趕快惡補的人 ,直接花十分鐘可以看完的一篇科普業配文章。 或者是概念僅止於,AI 這東西會幻想,會有誤差,會對於生活有些幫助但沒有幫助的人們,做個簡單又不是太簡單的介紹,希望用一個非常入門的方式讓你們有個了解。 當然,這篇文章目的很簡單, 就是引流 ,如果你身邊有已經對於 Web 技術開發的人員,歡迎報名分享給他,年末出國不如學一技在身,參加今年我們舉辦最後一場 RAG 實作工作坊,報名連結 , https://exma.kktix.cc/events/ai-for-dev-course-rag-2 注意: 接下來每個大段落結束都會有一段工商導入,但文章絕對精彩,請注意! 為了讓各位容易想像,我們將整個世界的資訊,先濃縮到這本『西遊記』的世界觀當中,我們整個世界都在這個 『西遊記』 ,而 大型語言模型 我們用 『書精靈』 來描述。 PS. 我們先預設各位,應該都有聽過,西遊記!如果沒有聽過西遊記的,請右轉出去,謝謝! 先來談談向量 在《西遊記》的世界裡,我們可以把 向量想像成一種「內容座標」 ,讓系統知道每個角色、場景、法術等的 「位置」和「距離」 。向量幫助語言模型知道不同內容之間的關聯程度。 向量就像內容的「距離」和「位置」 比方說,唐三藏的 「位置」(向量)會接近「佛經」和「取經」 的概念,因為他一路上都是為了取經而前進。孫悟空的 向量位置則會更靠近「金箍棒」和「七十二變」 這些概念,因為這些是他的特徵。 相似內容靠得更近:像「佛經」和「取經」會靠近唐三藏的向量,因為它們彼此有很強的關聯。 相差較大內容會離得較遠:像「取經」和「妖怪」「妖怪的寶藏」就距離比較遠,因為妖怪的寶藏和取經的目標關聯性不大。 是誰決定的這些位置? 簡單來說,這些位置和關係是模型自己學出來的。語言模型會閱讀大量的資料和這世界觀的資訊,觀察哪些詞語經常一起出現,根據「共同出現的頻率」來決定它們的關係,並且自動生成向量。例如: 如果模型看到 「唐三藏」 總是和 「取經」 一起出現,它就會讓「唐三藏」的向量靠近「取經」。 ...

Vibe Coding:為什麼 Junior 更快上手?Senior 要如何追趕?

現象層面(市場觀察) 最近有篇文章討論 junior & senior 開發者在 AI 時代的角色轉變,非常熱門。 身為 Cympack 產品開發團隊 ,我們也一直關注這個議題,在閱讀這篇文章時觀察到一些有趣的現象,對我們來說,這正好反映出 AI 正在改變開發生態,junior 借力 AI 快速成長、senior 則需要在 「架構思維」 與 「多 agent 協作」 中找到新定位,其中有些啟發(insight) 可以跟大家分享。 為什麼 Junior 更容易上手 vibe coding? 心智負擔低 → Junior 沒有太多傳統 code workflow 的框架包袱 敢於嘗鮮 → Gen Z / 年輕工程師天生習慣用 prompt-based 工具、跟 LLM 互動 少「優雅程式設計」的束縛 → 不太糾結「這樣寫會不會不夠優雅」,反而 embrace 快速迭代、快速出成果 反觀 Senior: 熟悉大型系統設計 有豐富的「工程正統流程」知識(架構設計、測試策略、效能優化、設計模式) 對 AI 生成 code 的品質 / 維護性通常比較保留 部分 10+ 年資深工程師,對 prompt engineering 沒那麼熟練,還在觀望 技能面(未來的關鍵能力) Vibe coding 本質上 = prompt engineering + AI co-pilot 管理能力 能力項目 誰目前比較有優勢? Prompt 撰寫 / AI 互動 Junior 較強(熟悉 chat-based 流程) 系統設計 / 架構把關 Senior 較強 AI 生成 code 驗證 / Bug 察覺能力 Senior 較強(能看出潛在問題) 快速疊代 / Hackathon 式開發 Junior 較強 長期維護性 / 穩定性 Senior 較強 總結 Junior 確實更快適應 vibe coding,並且更習慣以 「chat-based coding」 的工作流開發。 Senior 擁有驗證 AI 產物與系統設計的深度能力,但若不主動練習 vibe coding,長期會逐漸落後於新一波開發潮流。 就如同在 GAI 技術年會分享,希望帶給各位的感受, 『與 AI 協...

v0 API 是什麼?怎麼用?一篇教你搞懂功能、價格,還能搭配 Cursor 玩出 vibe coding!

Vercel 的 v0 是一款 AI 驅動的前端開發工具,能夠將自然語言描述轉換為可部署的 React 元件和 UI 介面,支援 Tailwind CSS,並可直接部署至 Vercel 平台。此外,v0 提供 API 介面,讓開發者能將其整合至其他工具,如 Cursor IDE,進一步提升開發效率。 Vercel v0 API 介紹 v0 API 目前處於 Beta 階段,主要提供 v0-1.0-md 模型,具備以下特點: 多模態支援:接受文字與圖片(base64 編碼)輸入。  快速串流回應:提供低延遲的串流回應。  OpenAI 相容:遵循 OpenAI Chat Completions API 格式,易於整合至現有工具。  前端開發優化:特別針對 Next.js 和 Vercel 等現代前端框架進行優化。 要使用 v0 API,需訂閱 Premium 或 Team 方案 ,並啟用使用量計費。 使用方式 API 端點: POST https://api.v0.dev/v1/chat/completions 請求標頭: Authorization: Bearer YOUR_V0_API_KEY Content-Type: application/json 參數範例: { "model": "v0-1.0-md", "messages": [ { "role": "user", "content": "建立一個具有身份驗證功能的 Next.js AI 聊天機器人" } ], "stream": true } 您也可以使用官方的 AI SDK 進行整合: npm install ai @ai-sdk/vercel 範例程式 javascript import { generateText } from 'ai'; import { vercel } from '@ai-sdk/vercel'; const { text } = await generateText({ model: vercel...