Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Bhushan001 opened this issue Sep 12, 2016 · 3 comments
Closed

Comments

@Bhushan001
Copy link

Bhushan001 commented Sep 12, 2016

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.

@ValeryVS
Copy link
Contributor

See --proxy-config

There are docs in PR
#1896

@filipesilva
Copy link
Contributor

@ValeryVS's comment is the best way I know to do this as well.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants