Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember-CLI: Where is the application route?

I am trying to install the npm package rails-csrf. The instructions on the rails-csrf github site say to "add a before model to your application route so your token is fetched automatically." Where is the application route?

I think it is supposed to be app/routes/application.js but that file does not exist. Shouldn't that be created by default with the ember new command?

like image 652
Corey Quillen Avatar asked Jan 27 '15 05:01

Corey Quillen


People also ask

What is a route in Ember?

When your application starts, the router matches the current URL to the routes that you've defined. The routes, in turn, are responsible for displaying templates, loading data, and setting up application state. To define a route, run ember generate route route-name. This creates a route file at app/routes/route-name.

How do I open Ember command line?

Open http://localhost:4200 in your browser of choice. You should see an Ember welcome page and not much else.

What is Ember CLI?

Ember CLI, Ember's command line interface, provides a standard project structure, a set of development tools, and an addon system. This allows Ember developers to focus on building apps rather than building the support structures that make them run.

Which command is used to install the Ember CLI?

Installing Ember is done using NPM. While you're at it we recommend you to also install phantomjs (if you don't have it already). Ember CLI uses phantomjs to run tests from the command line (without the need for a browser to be open).


1 Answers

It's not created by default.

You can use the ember-cli's generator to create one:

$ ember generate route application

Hope this helps!

like image 108
andrusieczko Avatar answered Sep 22 '22 12:09

andrusieczko