Thursday, March 30, 2017
In our AngularJS SPA application we will be using the Express web server to serve up our web application. In the previous blog post we installed the Express-generator globally. Now we can install Express in the root folder of our SPA application.
Here are the steps to create an Express application:
1. Open the command line prompt at the root folder of the SPA application
Here are the steps to create an Express application:
1. Open the command line prompt at the root folder of the SPA application
Wednesday, March 29, 2017
Logging is a good service to add as the application gets more complicated. It will allow us to see what the error is when things goes wrong.
To add logging to our ASP.NET Core application follow the steps below:
1. Open the Startup.cs file and add the logging service to the ConfigureServices method with the line
services.AddLogging();
So your ConfigureServices method should look like the following
To add logging to our ASP.NET Core application follow the steps below:
1. Open the Startup.cs file and add the logging service to the ConfigureServices method with the line
services.AddLogging();
So your ConfigureServices method should look like the following
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); var connectionString = Startup.Configuration["Data:NorthwindContextConnection"]; services.AddDbContext(options => options.UseSqlServer(connectionString)); services.AddLogging(); }
Thursday, March 23, 2017
In order to install the Express web server on the fly on your machine you need to install the Express generator. Fortunately with NodeJS it is as easy as typing in a command in the command line. This step used to install Express globally so that it will be easy for development.
Here are the steps to install Express generator globally:
1. Open up the command line and type in the following command
npm install -g express-generator
Here are the steps to install Express generator globally:
1. Open up the command line and type in the following command
npm install -g express-generator
Wednesday, March 22, 2017
In the previous blog we created the NorthwindCafe database with Entity Framework Core. Now we are going to seed the database so that we can work with the data.
Here are the steps to seed the NorthwindCafe database:
1. Create a file call DBInitializer in the NorthwindCafe.Web folder, in the file type in the following code
Here are the steps to seed the NorthwindCafe database:
1. Create a file call DBInitializer in the NorthwindCafe.Web folder, in the file type in the following code
using System.Linq; namespace NorthwindCafe.Web.Models { public class DbInitializer { public static void Initialize(NorthwindContext context) { context.Database.EnsureCreated(); if(context.Categories.Any()) { return; } var categories = new Category[] { new Category {Name = "Coffee", Description="Coffee", Products = new Product[] { new Product { Name = "Dark Roast", Description = "Dark Roast", Price = 2.0M } } }, new Category {Name = "Tea", Description="Tea", Products = new Product[] { new Product { Name = "Chai", Description = "Chai", Price = 1.5M } } }, new Category {Name = "Pastry", Description="Pastry", Products = new Product[] { new Product { Name = "Cupcake", Description = "Cupcake", Price = 1.25M } } }, new Category {Name = "Food", Description = "Food", Products = new Product[] { new Product { Name = "Hamburger", Description = "Hamburger", Price = 5.0M } } } }; foreach (var c in categories) { context.Categories.Add(c); } context.SaveChanges(); } } }
Thursday, March 16, 2017
In the previous blog post we created a configuration file for our MongoDB database in this post we will install MongoDB as a Windows service so that we don't have to start the service in the command line every time we want to use it to save development time.
Here are the steps to install MongoDB:
1. Open the command prompt as an "Administrator"
2. Change the mongo-db-config.conf file to use absolute paths. You can get the instructions on how to create a MongoDB configuration file in this blog post
dbpath = C:\techjunkie\mongodb\db
logpath = C:\techjunkie\mongodb\mongo-db-server.log
verbose = vvvvv
if the folder dpath folder does not exists in Windows create the folder "db" inside the "mongodb" folder, else the service start will fail
Here are the steps to install MongoDB:
1. Open the command prompt as an "Administrator"
2. Change the mongo-db-config.conf file to use absolute paths. You can get the instructions on how to create a MongoDB configuration file in this blog post
dbpath = C:\techjunkie\mongodb\db
logpath = C:\techjunkie\mongodb\mongo-db-server.log
verbose = vvvvv
if the folder dpath folder does not exists in Windows create the folder "db" inside the "mongodb" folder, else the service start will fail
Thursday, March 9, 2017
In the previous blog post be installed mongoDB now, we are going to create a configuration file for mongoDB to use during startup.
In this configuration file we will specify the following:
In this configuration file we will specify the following:
- location of the data files
- log file path
- the verbosity of the log file
Here are the steps:
- Create a folder in your operating systems
- create a file call mongo-db-config.config in the folder
- Type in the following lines of configuration settings
dbpath = /techjunkie/mongodb/db
logpath = /techjunkie/mongodb/mongo-db-server.log
verbose = vvvvv
dbpath : specifies the path of the data files
logpath : specifies the path of the log file
verbose: specifies how verbose we want out log files to be, in this we want our log files to be very verbose we want to log everything. The settings is from v to vvvvv going from least to most verbose
Thursday, March 2, 2017
Now that we have our AngularJS environment set up we need a database. We are going to use MongoDB as a database. MongoDB is a NoSQL database which is a perfect fit for JavaScript centric applications that we are building. To install MongDB go to https://www.mongodb.com/download-center?jmp=nav#community to make sure you are installing the "Community Edition" of MongoDB. On the "Community Server" tab select the operating system that you will be installing MongoDB in, then click on the "Download button.
Subscribe to:
Posts (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu