2

I am building a simple app that allows users to search for popular products in amazon by how much they are willing to pay by calling the amazon product api. I will probably only need 3-4 screens and won't have a authentication system.

Do I need a back-end framework? Or can I just use angular to make the api call and redirect them to the amazon with the shopping cart populated?

  • 1
    You still need the backend to hold and serve the pages to the client. Using a framework like Symfony on the backend might be overkill though if it can't be quickly setup to deliver pages only. – MingShun Mar 21 '15 at 02:35

1 Answers1

0

You can do everything in AngularJS on the front end. Which means you don't need a backend database.

However, like @MingShun mentioned, you do need some way of serving up your static files, such as your HTML, CSS, JS and images. But there are plenty of options for static file hosting out there, many of which are free or very cheap.

GregL
  • 37,147
  • 8
  • 62
  • 67
  • Why can't I just add a few html files and serve those up when I need to? I'm a little confused on why I need a backend if I can set up html and css just within one directory. I envision the directory having a index.html, a few partial html files for rendering different views, then a app.js file that will handle all the angular logic and api calls. Is that not enough? – Stack Juice2 Mar 21 '15 at 15:51
  • How are you planning to serve up those HTML, JS and CSS files? [AngularJS routing doesn't work](http://stackoverflow.com/questions/19502978/do-angular-views-work-when-a-site-is-served-from-the-local-file-system) if using `file://` to [access HTML files from your own hard drive](http://stackoverflow.com/questions/24124509/why-does-angularjs-ng-view-not-work-locally). You will need some sort of very basic web server to serve those files so the partials for each page/route can be loaded via AJAX. – GregL Mar 21 '15 at 16:05
  • One way around needing to fetch the partials via AJAX is to use something like [grunt-html2js](https://github.com/karlgoldstein/grunt-html2js) to include them as an angular module which primes Angular's `$templateCache` so it doesn't need to fetch them. – GregL Mar 21 '15 at 16:06