Skip to content

HelloWorld_Application

mwaylabs edited this page Jan 20, 2011 · 8 revisions

Building your first application

**First install node.js **

=== Mac OS X or Linux ===

see description here: http://nodejs.org/#download

  • Tested with node 0.2.6

=== Installing node.js on Windows ===

On Windows you need to run node.js in Cygwin

Read the instructions here: https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-%28Windows%29

  • Tested with node 0.2.5 on Windows 7

Get Espresso

You can download the latest version of Espresso, containing all need files, from here http://www.the-m-project.net/latest_stable.zip

Or from git. Therefor make sure git is installed on your computer. Open the terminal and type:

  git clone git://github.com/mwaylabs/Espresso.git

Browse into the generated Espresso folder and type:

  node m-init.js -w myFirstProject

3.) Espresso should prompt with:

 style.css generated!
 m-build.js generated!
 m-server.js generated!
 m-gen.js generated!
 config.json generated!
 main.js generated!

Alexanders-MacBook-Pro:Espresso alexander$ cd ..
Alexanders-MacBook-Pro:Arbeit alexander$ cd Apps/

3.) A new Folder called 'Apps' was created, this folder is a container for all of your The-M-Project Applications. The Apps folder, is located in the same directory as you have installed Espresso into. Type:

cd ..
cd Apps/

4.) To build the application type, from inside of /Apps/myFirstProject, : This will generate a basic application, with one page, header and footer ... displaying the text: "Welcome to The M-Project"

cd myFirstProject/
node m-server.js

Espresso should prompt with:

Building application: "myFirstProject"
Building components:
calling build() for: "myFirstProject_App"
calling build() for: "myFirstProject_AppResources"
calling build() for: "core"
calling build() for: "ui"
calling build() for: "jquery"
calling build() for: "jquery_mobile"
calling build() for: "underscore"
calling build() for: "themes"
calling build() for: "IndexHtml"
IndexHtml: done
=== used resouces ===
app/resources/base/style.css
myFirstProject_AppResources: done
jquery: done
jquery_mobile: done
underscore: done
ui: done
myFirstProject_App: done
core: done
themes: done
Server running at http://127.0.0.1:8000/myFirstProject

Open the url in your browser. (WebKit based Browser is recommended, Google Chrome or Safari )

Server running at http://127.0.0.1:8000/myFirstProject

You should see the following:

Clone this wiki locally