Signup for the Ionic Newsletter to get the latest news and updates!

  • Toke Refstrup

    Very nice tutorial. It seems to me that you are pushing both the backend and the app to heroku, why do we need the app there?

    • jplwood

      We made the tutorial web-only to focus in on the way to build a simple app using Ionic 2, Angular 2, connect it up to a Node.js backend and put it up on Heroku. We push the app up to Heroku so it’s accessible via the Heroku domain that’s specific to your app.

      • Toke Refstrup

        Ah ok, thanks.

  • http://mithsoft.in Nikhil Jauhari

    i was really interested in creating MEAN ionic2, and here it is thanks Justin. Appreciated.

  • jmtaleno

    Heroku Mongolab is asking for a credit card. 🙁

    • Graciele E. Victor

      Yep, faced the same here.

      Only way I’ve found to fix it was to actually insert CC information in Heroku website.. don’t worry, this sandbox option is really free..

      • Graciele E. Victor

        after inserting your CC infos, type this command:

        heroku addons:create mongolab:sandbox

        • jmtaleno

          Thanks @gracieleevictor:disqus! Yeah I did and it worked!

          • jplwood

            You shouldn’t have to put in your cc info, I never did — but I’m glad you got it working!

  • jmtaleno

    Hi Justin, I’m getting an Application Error when I tried to open my heroku app. And also curl is not working for me. Please help. Thanks!

  • Sagiv Frankel

    Thanks for the hard work – great series. The one thing I think is missing is adding the build as part of the Heroku deploy instead of committing the build directory which is bad.

    If I get it working for me I will add a pull request.

  • Abubaker Shekhani

    What if we don’t want to use Heroku? Is it possible to follow this tutorial without Heroku?

    • jplwood

      You certainly don’t have to follow the Heroku parts and just work locally. However, you would need to look into adding a local mongodb instance. It might be easier just to do the heroku part so you have a hosted DB to use (You can use it locally for the purpose of the tutorial). But generally, there’s plenty we work through that’s Ionic 2/Angular 2 specific that should be useful!

  • Graciele E. Victor

    I got a “Bad Request” response when trying to execute that curl command on CMD..

    if you’re facing the same just use Cygwin64 and it will work fine…

    ( just to save time if someone is facing the same… )

    • Jack

      What does Cygwin64 do?
      Do I still enter
      $ curl -H “Content-Type: application/json” -d ‘{“description”:”Order a tall stack of pancakes, just because.”}’ https://my-app-name.herokuapp.com/api/todos
      ?

  • Graciele E. Victor

    Great article Justin ! Thanks for posting !

  • Graciele E. Victor

    Hi Justin, where/when did you define the database schema? How mongoDB knows what fields to create in the Collection?

    • jplwood

      If you never execute the cURL command, you’ll still be sending data to it via the API in that same format. Our `todos` table will just automatically take on the format of the JSON data being sent into it. If you want to be more explicit with defining a DB schema, Mongoose, instead of the standard MongoDB node driver, might be helpful!

  • mixersoft

    Having some problems with the tutorial. The api server works but the app is not serving from heroku. The `curl` statement also fails. see: https://forum.ionicframework.com/t/problem-one-mean-ionic-2-todo-app-on-heroku/61985

    any ideas?

    • jplwood

      Hey I replied in the forum, let me know in there if that wasn’t your problem!

  • http://tester.dev/ Tumiso Marebane

    Great tutorial!! Thanks guys – this was a lot of help

  • peb7268

    Another option as well is to use local storage or localForage from Mozilla as the data store.

  • Hunter Munday

    Thanks for the great tutorial, I’m having an issue with my modules not importing in VSCode. I don’t have this problem with any other projects, just this one. Could there be something going on with heroku/git that is causing this? For example, when I created the todo.ts file, and tried to import it in the todo-service.js file, it would not import. Interestingly enough, the compiler would not give me any error at all no matter what path or classname I gave it.