Jimmy Bellmon Jimmy Bellmon - 11 months ago 88
Javascript Question

add angular 2 to existing express structure

I created an express structure using

giving the standard structure:

public routes

I would like to add to the views and routes directory as such:

->->sign up
->->sign in

using routes, index folder (index.js) and about folder (about.js) ...and so on...:

router.get('/', function(req, res, next) {

router.get('/about', function(req, res, next) {

I'm thinking each folder to render the angular 2 index.html. There are not too many examples on how to add angular 2 on an existing express structure. I know how to create, use, and program in an angular 2 structure. It's the setup that gets me. I'm a programmer a coder, and installing these various structures are new to me. I have tried express angular generators but they are are too heavy with a bunch of files and folders I don't need. I just need a simple structure for the index.html and the component.ts files to code in. How can I set this up without changing all the code and structures I already have in express? Also what is the simplest 'best practice' structure I can use to just place angular inside the desired folders?

Thanks all!

My aim is to be able to share information between the Nodejs system apps and the Angular 2 client apps. I know that I can do this by creating APIs between the two servers. My question is, is this the best practice or is there another method to use to accomplish this more efficiently?

Answer Source

Meteor.js is a Godsend. Trying to create a Fullstack just so I can start programming for a while now, but I could never create the best system I need for everything. 2hrs after installing Meteor.js and I'm ready. I now have about 2 weeks of production creating my application. And still get to use Angular 2! Like I mentioned above, I'm a programmer a coder, with PHP and C# experience, and installing these various structures are new to me. I'm used to just start writing programs. But I'm glad I got the experience of trying to create my own.