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?
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.
Open http://localhost:4200 in your browser of choice. You should see an Ember welcome page and not much else.
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.
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).
It's not created by default.
You can use the ember-cli's generator to create one:
$ ember generate route application
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With