0

I have a project built using the angular-fullstack generator for Yeoman. I would like to deploy this to a Windows Server running IIS. I have successfully generated the "dist" folder using Grunt and moved the "public" and "server" folders with files to my IIS box.

How do I configure my Windows Server to host my application? Do I need to have two IIS sites (one for "public" and one for "server")? Do I need to install grunt, bower, etc. on the Windows Server?

Bibble
  • 103
  • 1
  • 11

3 Answers3

1

You don't have to manually install grunt nor bower. Install locally the node components declared in package.json using the following comman:

npm install

The angular-fullstack generator creates a Node.js application, so all you have to do is run the server side application. Run /server/app.js with Node.js

You can check how to run Node applications inside IIS here: http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx

pfernandom
  • 929
  • 10
  • 22
0

You have to deploy the application on iisnode the do the right configuration for you web.config file I currently are able to run the application using the nodejs server but not in the iisnode applications because my web.config file still working correct I posted a question with more information here

Community
  • 1
  • 1
Cesar Vega
  • 455
  • 6
  • 15
0

This is just to give you a hint to the way to a solution. It´s not a detailed step by step answer.

If alredy using Grunt, you can use this grunt plugin. It´s a wrapper of the msdeploy.exe command so you need to learn about that here.

Before all of this you need to install Web Deploy on your server. There are serveral strats and posts about this. I choosed using the Remote Agent way.

I manually create the website (don´t know how to do this remotely yet. Working on that. That´s why I found this question) before I deploy. Then I just sync directories in my computer (your /dist folder) and the path in the remote server.

This a piece of my Gruntfile.js with 2 examples defined in the grunt.initConfig()

'Backup' saves in a package (zip file) the current remote directory. The second task called 'Oper' syncs your current build located on <%= yeoman.dist %>

msdeploy: {
    backup: {
        options: {
            verb: "sync",
            source: {
                dirPath: '<%= deploy.Config.basePathOper %><%=deploy.Oper.Web %>,computerName=<%=deploy.Config.computerName %>,username=<%=deploy.Config.username %>,password=<%= deploy.Config.password %>'
            },
            dest: {
                package: '<%= deploy.Config.basePathOper %>\\backups\\web_' + grunt.template.today("yyyy-mm-dd-HH-MM-ss") + '.zip,computerName=<%=deploy.Config.computerName %>,username=<%=deploy.Config.username %>,password=<%= deploy.Config.password %>'
            }
        }
    },
    Oper: {
        options: {
            verb: 'sync',
            source: {
                dirPath: process.cwd() + '\\<%= yeoman.dist %>'
            },
            dest: {
                dirPath: '<%= deploy.Config.basePathOper %><%=deploy.Oper.Web %>,computerName=<%=deploy.Config.computerName %>,username=<%=deploy.Config.username %>,password=<%= deploy.Config.password %>'
            }
        }
    }

The task I created looks something like this

grunt.registerTask('deploy', function (target) {
  if (target === 'Oper') {
      grunt.task.run([
      'msdeploy:backup',
      'msdeploy:Oper'
      ]);
  }

});

Don´t forget to load the plugin:

grunt.loadNpmTasks('grunt-msdeploy');
acromm
  • 880
  • 13
  • 24