I am developing an app that can utilize sails.js for back-end and AngularJS for Front-end. I thought that I'll create an Angular App using Yeoman-angular generator https://github.com/yeoman/generator-angular, and once I am done with the front-end logic I'll create a sails app using,
- npm install -g sails
- sails new app
And then I'll transfer all my AngularJS files to the Sails folder.
But the thing is that AngularJS creates creates a folder hierarchy like this https://github.com/rishy/angular-jade-stylus-seed and on running "grunt server" a "dist" folder is created which contains the final production version.
On the other hand, after "sails new app" folder hierarchy for sails app is like.
- api
- adapters/
- controllers/
- models/
- policies/
- services/
- assets
- images/
- js/
- styles/
- favicon.ico
- robots.txt
- config/
- node_modules/
- views
- home/
- 403.ejs
- 404.ejs
- 500.ejs
- layout.ejs
- Gruntfile.js
- app.js
- package.JSON
So, My questions are:
- Now, how do I transfer my Angular Files to this sails directory and how should I structure it?
- Since sails uses "sails lift" to start a server and angular uses "grunt server", which one of those should I use to start the server for my sailsJs + AngularJs app and what about the "dist" folder which is created after AngularJS?
- What changes will I have to make in the Gruntfile.js, since it should now contain the code from both Angular and Sails?
- Where should I keep my different views and style files and how should I access those form Angular or from Sails?
I think lot of people are facing this similar problem since AngularJS and SailsJs are all the rage currently. There should be a robust boilerplate to create an AngularJS + SailsJS app, which sadly is missing right now.