Skip to content

Commit

Permalink
angular+C# end of sesstion
Browse files Browse the repository at this point in the history
  • Loading branch information
mdhayath64 committed Sep 9, 2023
1 parent 8cd33f3 commit 3c47443
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 13 deletions.
5 changes: 2 additions & 3 deletions Angular/CSharp_Angular/DatingApp/API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
{
opt.UseSqlite(builder.Configuration.GetConnectionString("DefaultConnection"));
});
builder.Services.AddCors();

var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseHttpsRedirection();

app.UseAuthorization();
app.UseCors(builder => builder.AllowAnyHeader().AllowAnyMethod().WithOrigins("https://localhost:4200"));

app.MapControllers();

Expand Down
2 changes: 1 addition & 1 deletion Angular/CSharp_Angular/DatingApp/client/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down
10 changes: 9 additions & 1 deletion Angular/CSharp_Angular/DatingApp/client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"src/assets"
],
"styles": [
"./node_modules/ngx-bootstrap/datepicker/bs-datepicker.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/font-awesome/css/font-awesome.min.css",
"src/styles.css"
],
"scripts": []
Expand Down Expand Up @@ -57,6 +60,11 @@
"defaultConfiguration": "production"
},
"serve": {
"options": {
"ssl": true,
"sslCert": "./ssl/localhost.pem",
"sslKey": "./ssl/localhost-key.pem"
},
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
Expand Down Expand Up @@ -98,4 +106,4 @@
"cli": {
"analytics": false
}
}
}
54 changes: 54 additions & 0 deletions Angular/CSharp_Angular/DatingApp/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Angular/CSharp_Angular/DatingApp/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"@angular/platform-browser": "^16.2.0",
"@angular/platform-browser-dynamic": "^16.2.0",
"@angular/router": "^16.2.0",
"bootstrap": "^5.2.3",
"font-awesome": "^4.7.0",
"ngx-bootstrap": "^11.0.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<h1>{{title}}</h1>
<h1>{{title}}</h1>

<ul>
<li *ngFor="let user of users">
{{user.id}} - {{user.userName}}
</li>
</ul>
19 changes: 16 additions & 3 deletions Angular/CSharp_Angular/DatingApp/client/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Hello';
export class AppComponent implements OnInit {
title = 'Dating App';
users: any;

constructor(private http: HttpClient) { }

ngOnInit(): void {
this.http.get('https://localhost:5001/api/users').subscribe({
next: response => this.users = response,
error: error => console.log(error),
complete: () => console.log('Resuest has completed')

})
}
}
12 changes: 8 additions & 4 deletions Angular/CSharp_Angular/DatingApp/client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ import { HttpClientModule } from '@angular/common/http';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

@NgModule({
declarations: [AppComponent],
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserModule,
AppRoutingModule,
HttpClientModule],
HttpClientModule,
BrowserAnimationsModule
],
providers: [],
bootstrap: [AppComponent],
})
Expand Down
28 changes: 28 additions & 0 deletions Angular/CSharp_Angular/DatingApp/client/ssl/localhost-key.pem
Original file line number Diff line number Diff line change
@@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Qo5JUK
nmv/3sSlDqS8OdWMGhyhbEWRs2fcOkV5WjncDYvS5O2roiff5+a1GXs9KN5fJHxu
pI5vYyV2tQKBgDoVqD9iQqKjaXWZlqJtjaAa+3nMUidGb6BACfqMG6HW/QkxrE5Z
tmNR+v4U+ryQo063u3Wxs3GutscpB4z/JoFFwAAGNGJr6QjXPl5mNPZgRuEaYqQ7
plF1wLWvaSEk7dz79aTLkH9OE0wXuPn6Mnc9gRGti0hQLQi8ZXcYTbjPAoGBAKhn
oPkgt4IAFWvFhHPlpFh0V1rrUDjXyj//pa5DFeL+Dc7zWUcci9oMOAz/DFCpHE07
NmeojJjlW7o60bqDO/NcVHUjxfVEkblQyw15XBBf/XOQhU+FNS8qf5K0SZLaVXeW
IB1eDBHr5fp+BVl665k9dejqOjRD3IJYELVlJTFFAoGBAJ6cfYKN3J77h59e3vwM
urPnIVUHJSaqsbFQ+hK6QjxWaSWJXZULzDrI7USda/ktrSy+VkVWl5vhBXpmKCZv
k+KOPM/cHw0m13skxUa47L41pobo1KRLiAV8mjro0TYf/SDGyzbMgB3Xsac0JkHe
/BIb806nvIQ34Pl6iWcNYKX2
-----END PRIVATE KEY-----
26 changes: 26 additions & 0 deletions Angular/CSharp_Angular/DatingApp/client/ssl/localhost.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-----BEGIN CERTIFICATE-----
MIIEVjCCAr6gAwIBAgIRANE/xeWxImrSkYL2CN+TLfcwDQYJKoZIhvcNAQELBQAw
gY8xHjAcBgNVBAoTFW1rY2VydCBkZXZlbG9wbWVudCBDQTEyMDAGA1UECwwpTU9I
QU1NRURcbWRoYXlAbW9oYW1tZWQgKE1vaGFtbWVkIEhheWF0aCkxOTA3BgNVBAMM
MG1rY2VydCBNT0hBTU1FRFxtZGhheUBtb2hhbW1lZCAoTW9oYW1tZWQgSGF5YXRo
KTAeFw0yMzA5MDkxODMwMjRaFw0yNTEyMDkxODMwMjRaMF0xJzAlBgNVBAoTHm1r
Y2VydCBk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VQbvX1Wlt+6IqcQl6a8R851
L3O3hgl/Y/L88GebO1CBte7E74+WDaeCQUUIrdjFgHSAqGHXpgcl3WB8He9i05xL
q+vM/Qg2///Pyg==
-----END CERTIFICATE-----
7 changes: 7 additions & 0 deletions Angular/References.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ dotnet ef database update
**********Angualr Commands********************
npm install -g @angular/cli@16
ng new client -> creat new angular application
ng add ngx-bootstrap -> angulat bootstrap
npm install font-awesome -> also add to angular.json file "./node_module/font-awesome/css/font-awesome.min.css",

**********Other Commands********************
dotnet new list -> to get all the list of templates
dotnet new gitignore
dotnet new globaljson
dotnet tool list -g

**********installing the ssl certificate
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install mkcert
mkcert -install


0 comments on commit 3c47443

Please sign in to comment.