Modify task 1 as task 2
This commit is contained in:
parent
24906ae345
commit
e75a788578
1 changed files with 14 additions and 2 deletions
16
myApp.js
16
myApp.js
|
@ -2,9 +2,21 @@ let express = require('express');
|
|||
let app = express();
|
||||
|
||||
class TestApp1 {
|
||||
message = "Hello Express";
|
||||
default_path = "/";
|
||||
|
||||
/* Create a default response. */
|
||||
respond() {
|
||||
return(this.message);
|
||||
};
|
||||
|
||||
/* Handle requests and send default responses. */
|
||||
handle() {
|
||||
app.get(this.default_path, (REQUEST, RESPONSE) => {RESPONSE.send(this.respond());})
|
||||
};
|
||||
|
||||
constructor() {
|
||||
let MESSAGE = "Hello World";
|
||||
console.log(MESSAGE);
|
||||
this.handle();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue