-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add preliminary guide files (#554)
- Loading branch information
1 parent
16d224b
commit 590956e
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
For a list of all commands available in the CLI run the following: | ||
|
||
```bash | ||
lux --help | ||
``` | ||
|
||
For help with an individual command, you can use --help as well. | ||
|
||
```bash | ||
lux serve --help | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
### Installation | ||
|
||
```bash | ||
npm install -g lux-framework | ||
``` | ||
|
||
### Creating Your First Project | ||
|
||
Use the new command to create your first project. | ||
|
||
```bash | ||
lux new <app-name> | ||
``` | ||
|
||
### Running | ||
|
||
To run your application use the serve command. | ||
|
||
```bash | ||
cd <app-name> | ||
lux serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Routes are added in the function exported from ./app/routes.js. | ||
|
||
This function takes two arguments route and resource which are also functions. | ||
|
||
Declaring a route will add a single route to your application and requires you to provide the path as the first argument as well as the method and action in an options hash as the second argument. This function should only be used for defining custom routes. | ||
|
||
Declaring a resource will add all CRUD routes for a controller to your application. The resource function only takes one argument and that is the name of the resource. | ||
|
||
```javascript | ||
export default function routes() { | ||
this.resource('posts'); | ||
this.resource('users', function () { | ||
// GET /users/custom-route => UsersController#customRoute | ||
this.get('custom-route'); | ||
// GET /users/custom-route => UsersController#myCustomAction | ||
this.get('custom-route', 'myCustomAction'); | ||
}); | ||
} | ||
``` |