Initializing a Harp Application
Harp has a command line interface for creating a new project from scratch. This is the quickest way to try Harp.
Often, starting a project requires the same boilerplate code over and over. This command is helpful if you want to create a project with a sane starting point and common defaults.
- path – (String) Optional, this is the file path to where you want the project to be generated. It must be empty or no files will be generated. The path also assumes your current working directory.
In the following example, the default application will be created in the folder
harp init myproject
Default project structure
myproject/ |- _layout.jade |- 404.jade |- index.jade +- main.less
Using a boilerplate
-b flag allows you to initialize a new Harp app with a boilerplate on GitHub. The following would create a new project in
myproject/ directory using the boilerplate on github.com/kennethormandy/hb-remedy
harp init myproject --boilerplate kennethormandy/hb-remedy
You may also skip specifying a GitHub user entirely, and use one of the default Harp boilerplates.
harp init myproject --boilerplate docs
Using any project as a boilerplate
harp init -b phonegap/phonegap-start harp server www # Your project is now being served at http://localhost:9000