This project is done for private purposes like grabbing weather from open api resources. This project is REST, so it uses all .Net features that help us to create such websites.
The back-end side of WeatherAggregator is written on C# 5.0 and the front-end is written on BackboneTs (BackboneJs + typescript).
First of all, if you do not have the IIS server, install it to deploy your changes locally. You can skip all the information below if you know how to do it or you are going to deploy it somewhere else.
- Create two application pools to run the application locally. You can name them like WeatherApi and WeatherWebsite
- Open advanced settings and change the application identity to local system
- Create two websites like this
- My application requires ssl certificates. How to add website with https you can find there
- To build my application you need at least VS2013 with Typescript extension.
- Please find out that Typescript might not be built. In this case you should install a suitable version of TS compiler.
- Add the path to your back-end application at the URLConstants.ts.
- Build it.
- If all is done and you do not have errors you are able to see the result at https://yourip:port
- Find some service that provides any kind of weather api, it should return country name, city name and temperature in Celcius as json.
- Convert your found api into C# types by json converter
- Add them to the models project.
- Convert all inconsistent weather api fields by mapper into WeatherConvention model to use them later.
- Add new weather repository and instantiate it with your new weather api type.
- Add new metadata to be sure that your new weather api grabs data successfully.
- Resolve all occured errors by reading the output from debug. Probably you have forgotten to add your api name to WeatherNamesRepository or to resolve them in autofac.
- Enjoy :)