I planned to design a web app that provides apis and web site, this is because the app can be used with mobile.
I'm currently using node-restify to provide the api, but now I need a way to serve dynamic pages of the app.
My initial idea was to use just ExpressJS to provide pages and APIs but I've read node-restify is much faster. Now my problem is that with restify I cannot serve html pages rendered in ejs.
Is there a way to have one app only and integrate express with restify.
Any suggestion?
It's interesting what you've written here, because according to this benchmark (16th March 2012):
http://blog.perfectapi.com/2012/benchmarking-apis-using-perfectapi-vs-express.js-vs-restify.js/
Restify is a lot slower then Express.
Express can easily handle ~1500 requests per second while Restify only ~250 per second.
But even if they already improved Restify I doubt that it can be faster then Express which is already extremely fast. Not to mention that it is entire framework with very useful other tools.
Concluding: use Express.js.
Check this out for api:
https://github.com/rahpal/RestOnNode
RESTful framework on NodeJS
This project is build using the same project archutecture which is followed by ASP.Net WebApi 2.0. That means it will be having controllers, authentication mechanism etc. to start with. All you need to do is create your own controllers.