Skip to content

How to setup angular-cli for configuring node services for angular2 app? #2068

Closed
@Bhushan001

Description

@Bhushan001

Hi All,

I have setup the angular2 app using angular-cli@webpack.

Now I have my node services setup using gulp.
and I was starting it as :

`gulp.task('json-server',function(){

    // Start the server at the beginning of the task 

   console.log('Start the server at the beginning of the task');

   server.run(['server/json-server-starter.js']);

});`

in my package.json I modified script as:
"start": "start ng serve && start gulp"
thus, it was starting my angular2 app along with json-server.

I want to migrate it to webpack i.e. configure all of my node-services using webpack only.
But I am not able to find webpack.config.js file in my app from where I can start my node-server.

I also want to know what the ideal project structure should be?

I mean should I use express-generator and then modify it to add my angular2 app or I can use angular-cli structure itself to configure my node services?

I tried using cli structure but I dont know how to use webpack for starting my node-server too.

My Configurations :

  1. OS:
    Windows 7

  2. Versions.

    angular-cli: 1.0.0-beta.11-webpack.2
    node: 6.4.0
    os: win32 x64

  3. Repro steps. : ng new angular-mongo-connectivity

any inputs?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions