commit dd68dc063d64292ca9a24812d8e2b0c0854eb1fe
parent 1c8b11eb3e5edbda96ee67f0334831a8d444d2e8
Author: Agastya Chandrakant <me@hanabi.in>
Date: Mon, 18 May 2020 05:28:07 +0530
link param, service worker, rmv redundent files + roles, ascending
Diffstat:
6 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/server/server.js b/server/server.js
@@ -14,11 +14,27 @@ server.get('/', function (req, res) {
res.send('Hello from server');
});
+server.get('/help', function (req, res) {
+ res.send('This is a help page.');
+});
+
+server.get('/:to', function (req, res) {
+ const { to } = req.params;
+ res.send(`To: ${to}`);
+});
+
server.get('/:from/:to', function (req, res) {
const { from, to } = req.params;
res.send(`From: ${from} To: ${to}`);
});
+server.get('/:from/:fromDate/:to/:toDate', function (req, res) {
+ const { from, fromDate, to, toDate } = req.params;
+ res.send(
+ `From: ${from}\nFrom Date: ${fromDate}\nTo: ${to}\nTo Date${toDate}`
+ );
+});
+
function listening(port) {
console.log(`Server is now running on port ${port}...`);
}
diff --git a/src/App.js b/src/App.js
@@ -1,8 +1,9 @@
import React from 'react';
-import 'bootstrap/dist/css/bootstrap.css';
-import Header from './comp/header';
-import Footer from './comp/footer';
+import 'bootstrap/dist/css/bootstrap.min.css';
+
import CurrentTime from './comp/currentTime';
+import Footer from './comp/footer';
+import Header from './comp/header';
function App() {
return (
diff --git a/src/comp/autoCompleteText.js b/src/comp/autoCompleteText.js
@@ -51,15 +51,13 @@ function AutoCompleteText({ defaultValue = '', changeValue }) {
style={{ maxHeight: '50vh', overflow: 'scroll' }}
>
<h6 aria-level="6">
- <ul className="list-group" role="list">
+ <ul className="list-group">
{suggestions.length > 0
? suggestions.map((el, i) => (
<li
className="list-group-item list-group-item-action"
key={i}
onClick={() => handleClick(el)}
- role="listitem"
- // style={{ paddingLeft: 0 }}
>
{el.replace(/_/g, ' ')}
</li>
diff --git a/src/comp/footer.js b/src/comp/footer.js
@@ -8,9 +8,19 @@ function Footer() {
<div className="page-footer text-center">
<h5 aria-level="5">
Copyright © {year}{' '}
- <a href="https://en.wikinews.org/wiki/User:Acagastya">acagastya</a>.
- This project is licensed under{' '}
- <a href="https://opensource.org/licenses/BSD-3-Clause">
+ <a
+ href="https://en.wikinews.org/wiki/User:Acagastya"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ acagastya
+ </a>
+ . This project is licensed under{' '}
+ <a
+ href="https://opensource.org/licenses/BSD-3-Clause"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
BSD-3-Clause license
</a>
.
diff --git a/src/index.js b/src/index.js
@@ -13,4 +13,4 @@ ReactDOM.render(
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
-serviceWorker.unregister();
+serviceWorker.register();
diff --git a/src/setupTests.js b/src/setupTests.js
@@ -1,5 +0,0 @@
-// jest-dom adds custom jest matchers for asserting on DOM nodes.
-// allows you to do things like:
-// expect(element).toHaveTextContent(/react/i)
-// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom/extend-expect';