Code Monkey home page Code Monkey logo

ponyweather's Introduction

Pony Weather

You need the Timezonedb API key to make the backend work

Once you got the API key, make a folder name oauthTokens

And inside oauthTokens make a JSON file named token.json

And inside the token.json the object should look something like this

{
    "timezonedb": "<API KEY>",
    "github": "<API KEY with the permission of repo>"
}

Your directory should look something like that

oauthTokens/
└── token.json

Or you can set an environment variable named TIMEZONEDB and the vluae will be your <TOKEN>

Once everythign is set up, just run yarn start or npm start

And the serer by default will run on port 8080

Or if you already set your PORT ENV variable, it will use the PORT instead

Options

By default, the server will look for your current IP address and find the correct location

GET | /

http://localhost:8080/

But you can also input manually

GET | /<LOCATION>
http://localhost:8080/London

API

GET | /api/<LOCATION>
http://localhost:8080/api/London

If you didn't pass in the LOCATION, the API will look for your current location via your public IP address

The API return come with different data set

And the current support one will be

  • JSON
  • XML

To fetch XML(or any other data set in the future)

GET | /api/<LOCATION>
http://localhost:8080/api/London?type=xml

A Blog about this week end hacks

ponyweather's People

Contributors

felixfong227 avatar

Watchers

 avatar

ponyweather's Issues

Auto missing image repot

Whenever a user have a missing image, the system should report a missing at the Issues page at GitHub

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.