Git Product home page Git Product logo

f_weather's Introduction

A Nodejs Express Weather App on IBM i

FormaServe Logo

This repo contains a NodeJS Express website that runs on IBM i.

It shows a weather app giving the current weather for a city in the UK.

Pre-reqs

Requires Node.js on IBM i at least version 8

Install Instructions

These commands need to be run in a QSHELL session on your IBM i

Issue the following commands to clone the repo

git clone https://github.com/AndyYouens/f_Weather.git

CD into directory

cd f_Weather

Install dependancies

npm install

Get API key by creating an account at OpenWeatherMap

Start application

APIKEY=<your_api_key>
export APIKEY
npm start (to run in debug mode, type npm run debug)

Point your browser to https://your-IBMi:4000

Additional Setup

Save yourself time by placing your API key in a .env file in the root of this application.

Additionally, if you wish to change the PORT number this application runs on, this also can be placed in the .env file.
An example .env file is shown below.

APIKEY=58fe301faedc550510e8b2dd6222449x
PORT=4000
DEBUG=weather
HOSTNAME=GALATEA

The .env file should NOT be included within source control and should be added to your .gitignore file.

Authors

FormaServe Systems Ltd - All work - FormaServe

License

License

Acknowledgments

Andy Youens - FormaServe Systems Ltd - Twitter @AndyYouens

Latest Changes

Andy Youens - August 2020

Published PowerWire Article

September 2020

Copyright

ยฉ 1990 - 2020 FormaServe Systems Ltd

Open Source on IBM i - Oh Yea!

๐Ÿ˜‰

f_weather's People

Contributors

andyyouens avatar dependabot[bot] avatar theprez avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

theprez

f_weather's Issues

Invalid API key

    error: Error: cannot POST /data/2.5/weather?q=London%2Cuk&appid=%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A&units=metric (401)
        at Response.toError (/home/JGORZINS/projects/f_Weather/node_modules/superagent/lib/node/response.js:98:13)
        at ResponseBase._setStatusProperties (/home/JGORZINS/projects/f_Weather/node_modules/superagent/lib/response-base.js:119:48)
        at new Response (/home/JGORZINS/projects/f_Weather/node_modules/superagent/lib/node/response.js:44:8)
        at Request._emitResponse (/home/JGORZINS/projects/f_Weather/node_modules/superagent/lib/node/index.js:930:18)
        at /home/JGORZINS/projects/f_Weather/node_modules/superagent/lib/node/index.js:1127:42
        at IncomingMessage.<anonymous> (/home/JGORZINS/projects/f_Weather/node_modules/superagent/lib/node/parsers/json.js:22:7)
        at IncomingMessage.emit (node:events:406:35)
        at endReadableNT (node:internal/streams/readable:1329:12)
        at processTicksAndRejections (node:internal/process/task_queues:83:21) {
      status: 401,
      text: '{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}',
      method: 'POST',
      path: '/data/2.5/weather?q=London%2Cuk&appid=%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A&units=metric'
    },

Missing JavaScript files

Looks like several bootstrap/jquery files are not included in the project

GET /bootstrap/css/bootstrap.min.css 404 42.827 ms - 2021
GET /bootstrap/js/bootstrap.min.js 404 38.516 ms - 2021
GET /stylesheets/fss.css 304 40.056 ms - -
GET /stylesheets/style.css 304 41.011 ms - -
GET /bootstrap/css/bootstrap-theme.min.css 404 68.092 ms - 2021
GET /jquery/jquery-ui.min.css 404 94.075 ms - 2021
GET /bootstrap/js/bootstrap.min.js 404 25.544 ms - 2021

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.