陈斌彬的技术博客

Stay foolish,stay hungry

Mimosa 安装和使用

官网

Installation install Node and Mimosa

1) node.js/io.js

Mimosa is a NPM module and so it must be used with node.js or io.js. Mimosa is tested against node v0.10, v0.12 and the latest io.js, so you will need to download and install one of those.

2) Mimosa

Use npm to install Mimosa.

$ npm install -g mimosa

The -g flag installs Mimosa globally so it can be run from the command line anywhere. You may need to use sudo to install this depending on your system’s setup.

Create a starter app with Mimosa

If you want to build an app from scratch, or just play around with Mimosa, start here.

1) Create a new application

Inside the desired folder, create an app by executing mimosa new.

$ mimosa new nameOfApplicationHere

Follow the prompts and choose the desired transpilers/pre-processors, server, and server view technologies. If you aren’t sure which ones to choose, that’s perfect. Mimosa is a great tool to learn them.

2) Start the server

Change into the directory that was created and execute:

$ mimosa watch --server

Navigate to http://localhost:3000 in a browser to see the sample app. Mimosa will watch the assets directory of the project and compile changed files to the public directory. The web app serves assets in the public directory.

img

img

3) Start Coding

All set! To get the project started, Mimosa has delivered a bare bones web app with some code using the chosen technologies. Head over to the Commands tab to learn how to interact with Mimosa. If you want to play around with something meatier than the codebase that mimosa new delivers, try out a demo app.