I’ve been looking for a framework to build a mobile app. I found Meteor but decided to go with Node.JS as it seems to scale more properly.
The app basically consists of an Instagram-like system where you can login and share photos to everyone.
Now, as I am learning about web technologies and feeling a bit lost, I was thinking it would be good to have a REST API with Node.JS to which the Ionic app front-end connects. Is that something you would recommend? Or are there any better back-end solutions compatible with Ionic?
Could someone please clear this up for me? I’m really not sure where to start, and I don’t even know if this Node + Ionic stack is a good choice for me. Also, I would love to see some example projects that have a REST authentication API, this would really help me.
Thanks in advance for your time and your help,
Ulysse.
Personally I found that a NodeJS server running ExpressJS & MongoDB works out the best for me. I get full control over everything, and I could manually connect AWS/Google Cloud instances to it as well.
The RESTful APIs I create are usually hosted for free on Heroku then transferred to a paid hosting once it’s time to hit production.
Thanks a lot for the resources! Having your own server indeed seems like the way to go.
I found this project while looking on Github ( https://github.com/arthurkao/angular-drywall ).
It seems that it already has a RESTful API with authentication included, which the client uses.
It also looks like it uses Angular, so does it mean I can “convert” the web client to an Ionic project, keeping all the authentication system (API calls)?
Notice that I do not provide anything other than the path (and body, if posting) when I’m making a call. That’s because the Authroization headers are set by my login function. When I login, I get my JSON Web Token from the API. Then I store that token as my default header for every call that is made using $http. $http.defaults.headers.common.Authorization = JWT_TOKEN;
Whenever I need to make a call to the server I just run the following code from my controller:
API.get('profile').then(
function(res){
// Got a response
},
function(error){
// Got an error
});