From b2bc1bf0677656a2a5ae7f175f03f1d2b6f9d7a6 Mon Sep 17 00:00:00 2001 From: Revanth <109272714+revanth1718@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:08:16 +0530 Subject: [PATCH] Joke API --- New_APIs/Joke API/README.md | 17 ++++++++ New_APIs/Joke API/index.html | 20 ++++++++++ New_APIs/Joke API/index.js | 53 +++++++++++++++++++++++++ New_APIs/Joke API/package-lock.json | 45 ++++++++++++++++++++++ New_APIs/Joke API/package.json | 15 ++++++++ New_APIs/Joke API/style.css | 60 +++++++++++++++++++++++++++++ 6 files changed, 210 insertions(+) create mode 100644 New_APIs/Joke API/README.md create mode 100644 New_APIs/Joke API/index.html create mode 100644 New_APIs/Joke API/index.js create mode 100644 New_APIs/Joke API/package-lock.json create mode 100644 New_APIs/Joke API/package.json create mode 100644 New_APIs/Joke API/style.css diff --git a/New_APIs/Joke API/README.md b/New_APIs/Joke API/README.md new file mode 100644 index 0000000..b0cb39c --- /dev/null +++ b/New_APIs/Joke API/README.md @@ -0,0 +1,17 @@ +# Joke API Viewer App + +A simple web application to interact with the Joke API and display random jokes. + +## Features +- Fetch and display random jokes +- Deploy new Joke API apps +- Scale Joke API app resources +- Retrieve logs from Joke API apps + +## Installation +1. Clone the repository: + ```bash + git clone https://github.com/username/JokeAPIApp.git + +## Contributor +### Revanth \ No newline at end of file diff --git a/New_APIs/Joke API/index.html b/New_APIs/Joke API/index.html new file mode 100644 index 0000000..4ccb28b --- /dev/null +++ b/New_APIs/Joke API/index.html @@ -0,0 +1,20 @@ + + +
+ + + +${data.setup}
+${data.punchline}
+ `; + }) + .catch(error => console.error('Error fetching joke:', error)); +} diff --git a/New_APIs/Joke API/package-lock.json b/New_APIs/Joke API/package-lock.json new file mode 100644 index 0000000..cac9905 --- /dev/null +++ b/New_APIs/Joke API/package-lock.json @@ -0,0 +1,45 @@ +{ + "name": "joke-api-app", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-G7fYv8zS0D7ftu3gnLsOniwhgLU4k9v+1NEtFPP07/Oa8XJ51FtdUKLqIvsTcZo5ua23NO4s9Hr77BM19DOf1g==", + "requires": { + "accepts": "1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.6", + "qs": "6.7.0", + "range-parser": "1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "1.5.0", + "type-is": "1.6.18", + "utils-merge": "1.0.1", + "vary": "1.1.2" + } + } + } + } + \ No newline at end of file diff --git a/New_APIs/Joke API/package.json b/New_APIs/Joke API/package.json new file mode 100644 index 0000000..8574950 --- /dev/null +++ b/New_APIs/Joke API/package.json @@ -0,0 +1,15 @@ +{ + "name": "joke-api-app", + "version": "1.0.0", + "description": "A simple app to view jokes from the Joke API", + "main": "index.js", + "scripts": { + "start": "node server.js" + }, + "author": "Your Name", + "license": "ISC", + "dependencies": { + "express": "^4.17.1" + } + } + \ No newline at end of file diff --git a/New_APIs/Joke API/style.css b/New_APIs/Joke API/style.css new file mode 100644 index 0000000..ebdc4e5 --- /dev/null +++ b/New_APIs/Joke API/style.css @@ -0,0 +1,60 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(135deg, #89fffd, #ef32d9); + color: #fff; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; +} + +h1 { + font-size: 2.5em; + margin-bottom: 20px; +} + +#app { + text-align: center; + padding: 20px; + background: rgba(0, 0, 0, 0.5); + border-radius: 10px; +} + +h2 { + margin-top: 20px; + font-size: 1.5em; +} + +input, button { + margin: 10px 0; + padding: 10px; + border-radius: 5px; + border: none; +} + +button { + background: #ef32d9; + color: #fff; + cursor: pointer; +} + +button:hover { + background: #a726c1; +} + +#joke { + margin: 20px 0; + font-size: 1.2em; + background: rgba(0, 0, 0, 0.3); + padding: 10px; + border-radius: 5px; +} + +#setItem { + margin-bottom: 15px; +} + +#results { + margin-top: 20px; +}