Skip to content
Snippets Groups Projects
Commit f7508653 authored by ywb16155's avatar ywb16155
Browse files

commit #40 - Hosting Config

parent f840cd2b
No related branches found
No related tags found
No related merge requests found
......@@ -85,13 +85,6 @@
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<webResources>
<resource>
<directory>/home/elliot/IdeaProjects/omp-plus/ompp-web/target/ompp-web</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
<testResources>
......
spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://localhost:3306/ompdb
spring.datasource.url=jdbc:mysql://aa120m6cmptgb1a.cx4yxdv2ekw9.us-west-2.rds.amazonaws.com:3306/ompdb?useSSL=false
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=apiuser
spring.datasource.password=password
......
......@@ -13,7 +13,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "target/ompp-web",
"outputPath": "dist/ompp-web",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
......
......@@ -3,8 +3,8 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --ssl --ssl-key d:\\certificates\\localhost.key --ssl-cert d:\\certificates\\localhost.crt",
"build": "ng build",
"start": "ng serve",
"build": "ng build --prod --aot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>ompp-web</artifactId>
<name>ompp-web</name>
<description>ompp-plus frontend</description>
<parent>
<groupId>com.ompplus</groupId>
<artifactId>ompp-plus</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<configuration>
<nodeVersion>v11.10.0</nodeVersion>
<npmVersion>6.7.0</npmVersion>
<workingDirectory>src</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>target/ompp-web</directory>
<targetPath>static</targetPath>
</resource>
</resources>
</build>
</project>
......@@ -57,7 +57,7 @@ export class LoginComponent implements OnInit, OnDestroy, OnChanges {
}
}
private login(): void {
public login(): void {
this.isSubmitted = true;
if (this.isUsernameInvalid || this.isPasswordInvalid) {
return;
......
......@@ -4,6 +4,7 @@ import {HttpErrorService} from 'src/app/ErrorComponents/http-error.service';
import {Observable} from 'rxjs';
import {catchError} from 'rxjs/operators';
import {MinutePaperWrapperDao} from 'src/app/dao/minute-paper-wrapper.dao';
import {environment} from '../../environments/environment';
const httpOptions = {
headers: new HttpHeaders({
......@@ -18,61 +19,61 @@ export class LecturerInfoService {
}
public getLecturerClasses(username: String): Observable<String | Object> {
return this.http$.post('https://localhost:8443/getLecturerClasses', {username: username}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getLecturerClasses', {username: username}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getClassPapers(username: String, classCode: String): Observable<String | Object> {
return this.http$.post('https://localhost:8443/getClassPapers', {username: username, classCode: classCode}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getClassPapers', {username: username, classCode: classCode}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getPaperQuestions(paperId: String): Observable<String | Object> {
return this.http$.post('https://localhost:8443/getPaperQuestions', {paperId: paperId}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getPaperQuestions', {paperId: paperId}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getPaperAnswers(paperId: String): Observable<String | Object> {
return this.http$.post('https://localhost:8443/getPaperAnswers', {paperId: paperId}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getPaperAnswers', {paperId: paperId}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getTemplates(username: String): Observable<String | Object> {
return this.http$.post('https://localhost:8443/getTemplates', {username: username}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getTemplates', {username: username}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public createPaper(request: MinutePaperWrapperDao) {
return this.http$.post('https://localhost:8443/createPaper', request, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/createPaper', request, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public deletePaper(paperId: String) {
return this.http$.post('https://localhost:8443/deletePaper', {paperId: paperId}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/deletePaper', {paperId: paperId}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public createTemplate(request: MinutePaperWrapperDao) {
return this.http$.post('https://localhost:8443/createTemplate', request, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/createTemplate', request, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public deleteTemplate(paperId: String) {
return this.http$.post('https://localhost:8443/deleteTemplate', {paperId: paperId}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/deleteTemplate', {paperId: paperId}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getClassResponseData(username: String) {
return this.http$.post('https://localhost:8443/getResponseData', {username: username}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getResponseData', {username: username}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
......
......@@ -3,6 +3,7 @@ import {HttpClient, HttpHeaders} from '@angular/common/http';
import {HttpErrorService} from '../ErrorComponents/http-error.service';
import {catchError} from 'rxjs/operators';
import {Router} from '@angular/router';
import {environment} from '../../environments/environment';
const httpOptions = {
headers: new HttpHeaders({
......@@ -23,7 +24,7 @@ export class LoginService {
}
public login(username: String, password: String): any {
return this.http.post('http://localhost:8080/login', {username: username, password: password}, httpOptions)
return this.http.post(environment.apiUrl + '/login', {username: username, password: password}, httpOptions)
.pipe(
catchError(this.errorService.handleError)
);
......
......@@ -4,6 +4,7 @@ import {HttpErrorService} from 'src/app/ErrorComponents/http-error.service';
import {catchError} from 'rxjs/operators';
import {Observable} from 'rxjs';
import {StudentResponseDao} from '../dao/student-response.dao';
import {environment} from '../../environments/environment';
const httpOptions = {
headers: new HttpHeaders({
......@@ -18,43 +19,43 @@ export class StudentInfoService {
}
public getStudentClasses(username: String): Observable<String | Object> {
return this.http$.post('https://localhost:5000/getStudentClasses', {username: username}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getStudentClasses', {username: username}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getOpenPapers(username: String): Observable<String | Object> {
return this.http$.post('https://localhost:5000/getOpenPapers', {username: username}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getOpenPapers', {username: username}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getSubmittedPapers(username: String, classCode: String): Observable<String | Object> {
return this.http$.post('https://localhost:5000/getSubmittedClassPapers', {username: username, classCode: classCode}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '3/getSubmittedClassPapers', {username: username, classCode: classCode}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getPaperQuestions(username: String, paperId: String): Observable<String | Object> {
return this.http$.post('https://localhost:5000/getPaperQuestions', {paperId: paperId}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getPaperQuestions', {paperId: paperId}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public getStudentAnswers(username: String, paperId: String): Observable<String | Object> {
return this.http$.post('https://localhost:5000/getStudentAnswers', {username: username, paperId: paperId}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/getStudentAnswers', {username: username, paperId: paperId}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public saveDraft(answers: StudentResponseDao[]): Observable<String | Object> {
return this.http$.post('https://localhost:5000/saveDraft', {responses: answers}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/saveDraft', {responses: answers}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
public submitResponse(answers: StudentResponseDao[]): Observable<String | Object> {
return this.http$.post('https://localhost:5000/submitResponse', {responses: answers}, httpOptions).pipe(
return this.http$.post(environment.apiUrl + '/submitResponse', {responses: answers}, httpOptions).pipe(
catchError(this.errorService.handleError)
);
}
......
export const environment = {
apiUrl: 'https://omp-plus.us-west-2.elasticbeanstalk.com:8443',
debugMode: false,
production: true
};
......@@ -3,6 +3,8 @@
// The list of file replacements can be found in `angular.json`.
export const environment = {
apiUrl: 'https://localhost:8443',
debugMode: false,
production: false
};
......
......@@ -25,7 +25,6 @@
<modules>
<module>ompp-api</module>
<module>ompp-web</module>
</modules>
</project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment