Skip to content

Commit

Permalink
Updated UML
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentmoreschi committed Aug 2, 2022
1 parent 8c4b035 commit da7e324
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ yarn-error.log*
.env

*.http

OpenWeatherMap*
13 changes: 13 additions & 0 deletions OpenWeatherClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let PROTO_PATH = process.cwd() + './OpenWeatherMap-gRPC-API/proto';

let packageDefinition = protoLoader.loadSync(
PROTO_PATH,
{keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
});
let routeguide = grpc.loadPackageDefinition(packageDefinition).routeguide;
let client = new routeguide.RouteGuide('localhost:50051', grpc.credentials.createInsecure());

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Historical Weather:
```

## UML Diagram
![UML request](UML.png "UML")
![UML request](seq.png "UML")
8 changes: 5 additions & 3 deletions RouteGuideClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ var packageDefinition = protoLoader.loadSync(
oneofs: true
});
let routeguide = grpc.loadPackageDefinition(packageDefinition).routeguide;
let client = new routeguide.RouteGuide('localhost:50051', grpc.credentials.createInsecure());
let locdate = {latitude: 39.09972, longitude: -94.578331, year:2020,month:10,day:20};
let dt = {year:2020,month:10,day:20}
let client = new routeguide.RouteGuide('localhost:', grpc.credentials.createInsecure());

let locdate = {latitude: 35.09972, longitude: -94.578331, year:2020,month:10,day:20};
let dt = {year:2019,month:10,day:20}

function runGetHistoricalData(){
client.GetHistoricalData(locdate,function(err,response){
console.log(response);
Expand Down
2 changes: 0 additions & 2 deletions RouteGuideServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ async function getData(locdate){
let date= {year:locdate.year,month:locdate.month,day:locdate.day}


// console.log(dt)

const response = await fetch(`http://api.openweathermap.org/data/3.0/onecall/timemachine?lat=${latitude}&lon=${longitude}&dt=${ConvertToUnix(date)}&appid=`);
let data = await response.text();
console.log(data)
Expand Down
Binary file removed UML.png
Binary file not shown.
Binary file added seq.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da7e324

Please sign in to comment.