Giter Club home page Giter Club logo

weather-api's Introduction

Weather API

Setup

Pre-requisites:

  • Docker
  • docker-compose

Docker

Install Docker for your platform.

docker-compose

Install docker-compose for your platform.

  • Mac: Included with Docker
  • Windows: Included with Docker
  • Linux: Please see your distributions package management system

Misc.

We are using Ruby, Node, etc. through Docker. In order to use tools like Rails and Yarn through Docker, we must pass our commands to the Docker container. This is a really long command:

docker-compose -f docker-compose.cli.yml run --rm composer install

Because of this, it is recommended to create an alias for docker-compose -f docker-compose.cli.yml run --rm and call it dcli (Docker CLI).

Installation

First we need to clone the project.

cd ~/code # or whatever directory you keep your projects in

git clone https://github.com/MiguelTzab/weather-api.git
cd weather-api

Next we need to copy the docker-compose.yml.dist file and update it for our system.

cp .env.dist .env
cp docker-compose.override.yml.dist docker-compose.override.yml

Note: Personalize the docker-compose.override.yml for your system. If you are using Mac, it is recommended to change - .:/application to - .:/application:cached for the best performance. However, the default file will work out of the box.

Now that we have the application configured, we need to install our dependencies. Before doing that though we need the docker images we use.

docker-compose pull
docker-compose build

And finally it's time to start up our containers:

  • With docker:
docker-compose up -d
  • With rails command:
rails server # this run on port 3000

API Usage

To use the API, send a GET request to the following endpoint:

localhost:8004/api/v1/weather/cities?name={city_name}

Parameters

  • name: The partial or full name of the city (required).

Example

curl -X GET "localhost:3000/api/v1/weather/cities?name=chetumal"

weather-api's People

Contributors

migueltzab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.