Skip to content

Commit

Permalink
some updated with cert
Browse files Browse the repository at this point in the history
  • Loading branch information
somenathmaji committed Sep 16, 2021
1 parent 5dfbe04 commit 22e379b
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 40 deletions.
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,8 @@

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.2.6.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
## How to run
### install ssl certificate
npm gen:crt
### run the app server
npm start
18 changes: 18 additions & 0 deletions certificate.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[req]
default_bits = 2048
prompt = no
default_md = sha256
x509_extensions = v3_req
distinguished_name = dn
[dn]
C = IN
ST = Delhi
L = Delhi
O = My Organisation
OU = My Organisational Unit
emailAddress = [email protected]
CN = localhost
[v3_req]
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
File renamed without changes.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --port 3000 --ssl",
"start": "ng serve --port 3000 --ssl true --ssl-key ./localhost.key --ssl-cert ./localhost.crt",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"e2e": "ng e2e",
"gen:crt": "openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout localhost.key -days 3560 -out localhost.crt -config certificate.cnf"
},
"private": true,
"dependencies": {
Expand All @@ -32,6 +33,7 @@
"@types/jasmine": "2.5.38",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"@types/office-js": "^1.0.204",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
Expand All @@ -44,6 +46,6 @@
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.4.2",
"typescript": "~2.0.0"
"typescript": "^2.4.2"
}
}
4 changes: 1 addition & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div>
<h3>{{subject}}</h3>
</div>
{{subject}}
19 changes: 15 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import { Component } from "@angular/core";

import { ChangeDetectorRef, Component, NgZone, OnInit } from "@angular/core";

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
public subject = 'hello world';
export class AppComponent implements OnInit{

public subject = "";

ngOnInit(): void {
this.subject = Office.context.mailbox.item.subject;
Office.context.mailbox.addHandlerAsync(Office.EventType.ItemChanged, this.updateSubject);
console.log(this.subject);
}

public updateSubject() {
this.subject = Office.context.mailbox.item.subject;
console.log(this.subject);
}
}
7 changes: 3 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<!doctype html>
<html lang="en">
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Pinnate</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/x-icon" href="/src/favicon.ico">
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
</head>
<body>
<app-root></app-root>
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ if (environment.production) {
enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule);
Office.initialize = function () {
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
};
4 changes: 3 additions & 1 deletion src/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"target": "es5",
"module": "es2015",
"baseUrl": "",
"types": []
"types": [
"office-js"
]
},
"exclude": [
"test.ts",
Expand Down

0 comments on commit 22e379b

Please sign in to comment.