Search code examples
angularjsgulpwebfaction

Gulp to connect server on production


I'm trying to add my angular project to production with webfaction. However I'm not sure how to do it as there isn't really any documentation with webfaction regarding gulp and angular. I understand that theres a difference between development and production servers, but what I don't understand is the process of using gulp-connect for production...

This is what I have to start my local server in my gulpfile.js:

gulp.task('connect', function() {
  connect.server({
    root: './app',
    port: 8000,
    fallback: './app/index.html'
  });
});

How can/do I use gulp-connect on production?

Thank you for your help in advance.


Solution

  • Modules such as gulp-connect designed for development (fast start, easy to setup), but not for production (lack of security and performance).

    If you haven't any backend on your project (if this is only angularjs project, no server-side and db), then you no need to use any complex hosting platform. You actually required only for static server (which will provide your assets for user).

    You are able to use any of static hosting, like github pages.

    If you're want to up your own server, you can up you angular project with things like nginx.

    Of course you can write your own server with express, for example (lots of tutorials).