From 590956ed52c0bd4cd6defd0ef1faa1de032d4dd8 Mon Sep 17 00:00:00 2001 From: Zachary Golba Date: Mon, 5 Dec 2016 21:32:28 -0500 Subject: [PATCH] docs: add preliminary guide files (#554) --- guide/cli.md | 11 +++++++++++ guide/getting-started.md | 22 ++++++++++++++++++++++ guide/route-definitions.md | 19 +++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 guide/cli.md create mode 100644 guide/getting-started.md create mode 100644 guide/route-definitions.md diff --git a/guide/cli.md b/guide/cli.md new file mode 100644 index 00000000..4638b9d1 --- /dev/null +++ b/guide/cli.md @@ -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 +``` diff --git a/guide/getting-started.md b/guide/getting-started.md new file mode 100644 index 00000000..ffd870f6 --- /dev/null +++ b/guide/getting-started.md @@ -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 +``` + +### Running + +To run your application use the serve command. + +```bash +cd +lux serve +``` diff --git a/guide/route-definitions.md b/guide/route-definitions.md new file mode 100644 index 00000000..8f2c41b1 --- /dev/null +++ b/guide/route-definitions.md @@ -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'); + }); +} +```