This application is using Angular2 as front-end development framework, Express for developing REST API and Sequelize as Node.js ORM to query SQL Server.
To run this application you should have the following tools/softwares on your machine.
- Node.js
- VS Code IDE
- SQL Server
In order to setup and run this application, please follow the folowing steps.
In order to install node.js server dependencies, run the following command on application root level. Here, we are using windows OS.
C:\Node_Angular2_CRUD>npm install
In order to install Angular2 dependencies, first goto client folder.
C:\Node_Angular2_CRUD>cd client
Now, run the following command on client folder level to install Angular2 dependencies.
C:\Node_Angular2_CRUD\client>npm install
Please change the database settings as per your machine within .\server\config\db.js file.
const sequelize = new Sequelize('Angular2_Node', 'sa', 'dotnettricks', {
host: 'localhost',
port: '1434', // default port number or sql server running port number
dialect: 'mssql',
});
Make sure you have created database Angular2_Node with table Users and having columns - UserId: int, Name: varchar(50), Address: varchar(500), ContactNo: varchar(20).
In order to run your application, run the following command.
C:\Node_Angular2_CRUD>node server
If you are getting the message Server is running at http://localhost:1320, your application is running successfully.
1.0.0