跳到主要內容

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

    回覆刪除

張貼留言

這個網誌中的熱門文章

npm 還可以看影片,沒想到真的有人這麼做

 還真的有人做這件事情, 庆余年2剛上線,有一位小哥竟然利用 npm 包的機制,將整套高清視頻都搬上來了。 https://x.com/fengmk2/status/1791498406923215020 圖片來源, https://x.com/fengmk2/status/1791498406923215020/photo/1 此 Package 出處 https://www.npmjs.com/package/lyq2?activeTab=versions 截圖留念, 機制說明 NPM(Node Package Manager)是一個流行的 JavaScript 軟件包管理器,用於管理和分發 Node.js 應用的依賴。它允許開發者將自己的代碼打包成「包」,並上傳到 NPM 的公共註冊表,供其他開發者下載和使用。這個過程通常包括以下步驟: 創建 NPM 包 :開發者將自己的代碼和相關文件打包成一個 NPM 包。 上傳到註冊表 :將包上傳到 NPM 的公共註冊表。 下載和使用 :其他開發者可以通過 NPM 命令行工具下載並安裝這些包。 這位小哥利用這一機制,可能是通過將整套高清視頻文件打包成 NPM 包並上傳到公共註冊表。其他人只需通過簡單的 NPM 命令即可下載這些視頻文件。 影響 版權問題 :這種行為涉及明顯的版權侵犯。高清視頻通常受到版權保護,未經授權的分發和下載都是非法的。 NPM 註冊表的可靠性 :這類內容的出現可能會損害 NPM 註冊表的可靠性和聲譽。NPM 註冊表是開發者分享和使用代碼的重要平台,如果充斥著這些不合法的內容,會影響其公信力。 潛在的安全風險 :將視頻文件偽裝成 NPM 包可能會帶來潛在的安全風險。下載這些包的用戶可能會無意中下載到惡意軟件或其他有害內容。 技術濫用 :這一行為展示了技術的濫用,原本為了方便開發者分享和使用代碼的機制,被用來分發非法內容,會對整個開發者社區造成負面影響。 歡迎留言給我,讓我們得到更多討論,一起回饋更多可能。 如果對於技術架構或者技術開發有相關需要顧問教育訓練服務或專案開發,聯絡方式如下,或者是與皇漢科技 EXMA-Square 進行聯繫。 FB: https://www.facebook.com/clonncd/ Twitter: https://twitter.com/clonncd 熱血漢誌: htt

Redis 已經不再免費了嗎?Redis is no longer free software ?

  根據Redis Source Available License 2.0 (RSALv2)的條款,這份授權協議提供了一定程度的使用、複製、分發、使其可用、以及創建衍生作品的自由,但這些自由受到特定限制,特別是關於將軟體功能作為服務提供給第三方或分發軟體的方式,這可能限制了軟體的自由共享和再分發。 根據自由軟體基金會(Free Software Foundation, FSF)和開源倡議組織(Open Source Initiative, OSI)定義的自由軟體和開源軟體的標準,一個軟體要被認為是“自由軟體”或“開源軟體”,它需要允許用戶在任何目的下運行軟體、研究和修改軟體、以及自由地重新分發複製品,有時還包括創建和分發衍生作品的自由。 RSALv2設置了一些重要的使用和分發限制,特別是關於禁止將軟體或其修改版本作為服務提供給第三方的限制,這可能不符合FSF和OSI對自由軟體或開源軟體的定義。這些限制主要是為了保護Redis Ltd.的商業利益,同時允許使用者在某些條件下使用和修改軟體。 因此,雖然RSALv2提供了一些使用和修改軟體的自由,但它由於上述限制,可能不會被廣泛認定為符合“自由軟體”或“開源軟體”的嚴格定義。它更像是一種介於傳統封閉源代碼軟體和開放源碼軟體之間的“源可用”授權模式。 主觀想法 怎麼開源的狀態下還是需要商業利益的支持,只有在商業模式下才能走得長久,這段協議會影響到的基本上三大公有雲 Azure / AWS / Google Cloud Platform 絕對首當其衝,但如果以服務提供商的角色,能夠跟這樣的開源坐下來好好談談,也許這樣的 Agreement 可能對於 Redis 後續的生態發展才會是好的方式? 就讓我們持續看下去! Ref: https://lwn.net/Articles/966133/ https://redis.com/blog/redis-adopts-dual-source-available-licensing/ https://redis.com/legal/rsalv2-agreement/

CSS Animation 救星?Apple 推出 Keyframer,讓 LLM 大型語言模型產生動畫

CSS Animation 救星?Apple 推出 Keyframer,讓 LLM 大型語言模型產生動畫 Apple 釋出 Keyframer 工具利用大型語言模型(LLMs)來為靜態圖像(SVG格式)創造動畫。 透過與專業動畫設計師和工程師的訪談,Keyframer 支援通過提示和直接編輯生成的輸出來探索和精煉動畫。此系統還允許用戶請求設計變體,支持比較和創意發想。包括用於描述運動的語義提示類型的分類和一種“分解式”提示風格,其中用戶不斷根據生成的輸出調整他們的目標。分享了如何通過直接編輯以及提示來實現超越當今生成工具中常見的一次性提示界面的迭代。通過這項工作,提出了LLMs 可能如何賦能廣泛的觀眾群體參與動畫創作。 對於網頁開發者或設計師,Keyframer提供了以下潛在的幫助和用途: 創意表達的擴展:開發者和設計師可以使用自然語言描述來創造或修改動畫,這樣可以快速實驗和實現創意想法,而無需深入複雜的動畫程式碼或工具。 高效的設計流程:通過結合語言提示和直接編輯,使用者可以迅速探索動畫設計的不同變體,加速從概念到原型的過程。 動畫設計的無障礙化:即使是沒有動畫背景的開發者和設計師也能輕鬆入門,透過自然語言的引導創造動感豐富的界面和視覺效果。 促進創意發想和迭代:Keyframer支持設計思維的迭代過程,讓使用者能夠不斷優化和細化他們的動畫設計,促進創意的深入發展。 個性化和定制動畫:用戶可以請求特定的設計變體,以滿足特定項目的需求或遵循品牌指南,從而創建更加個性化和定制化的動畫效果。 Keyframer為網頁開發者和設計師提供了一種全新的與動畫互動和創造的方式,使他們能夠更加自由地探索和實現創意視覺效果,從而提升用戶體驗和網站的吸引力。