commit
fdd9a42511
@ -0,0 +1,59 @@ |
|||||||
|
const fs = require("fs") |
||||||
|
const bodyParser = require("body-parser") |
||||||
|
|
||||||
|
const express = require('express') |
||||||
|
const app = express() |
||||||
|
const port = 3001 |
||||||
|
|
||||||
|
let allowCrossDomain = function(req, res, next) { |
||||||
|
res.header('Access-Control-Allow-Origin', "*"); |
||||||
|
res.header('Access-Control-Allow-Headers', "*"); |
||||||
|
next(); |
||||||
|
} |
||||||
|
app.use(allowCrossDomain); |
||||||
|
|
||||||
|
|
||||||
|
app.use(bodyParser.json()) |
||||||
|
|
||||||
|
const emails = JSON.parse(fs.readFileSync("emails.JSON")) |
||||||
|
const outboundemails = []; |
||||||
|
|
||||||
|
|
||||||
|
app.get('/emails', (req, res) => res.json(emails)) |
||||||
|
app.get('/emails/:id', (req, res) => res.send(emails[req.params.id])) |
||||||
|
|
||||||
|
app.get('/search',(req,res) => { |
||||||
|
const query = decodeURIComponent(req.query.query) |
||||||
|
const filteredEmails = emails.filter(email => email.subject.includes(query)) |
||||||
|
|
||||||
|
res.send(filteredEmails) |
||||||
|
}); |
||||||
|
|
||||||
|
app.get('/sent', (req, res) => res.json(outboundemails)) |
||||||
|
|
||||||
|
app.post('/send',function(req,res){ |
||||||
|
let result; |
||||||
|
const emailSender = req.body; |
||||||
|
//console.log("Received request: "+JSON.stringify(req.body));
|
||||||
|
if(emailSender.sender && emailSender.recipient && emailSender.subject && emailSender.message){ |
||||||
|
var emailContents = { sender: emailSender.sender, recipient: emailSender.recipient, subject: emailSender.subject, email: emailSender.message, }; |
||||||
|
emails.push(emailContents); |
||||||
|
outboundemails.push(emailContents); |
||||||
|
|
||||||
|
result = { |
||||||
|
"status": "success", |
||||||
|
"message": "The message was successfully sent" |
||||||
|
} |
||||||
|
}else{
|
||||||
|
result = { |
||||||
|
"status": "failed", |
||||||
|
"message": "The message was not sent" |
||||||
|
} |
||||||
|
res.status(400); |
||||||
|
} |
||||||
|
|
||||||
|
res.json(result); |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`)) |
@ -0,0 +1,21 @@ |
|||||||
|
[ |
||||||
|
{"sender": "katie@galvanize.com", "recipient": "jane@galvanize.com" , "subject": "Standup meeting", "message": "Mr. and Mrs. Dursley, of number four, Privet Drive, wereproud to say that they were perfectly normal, thankyou very much." , "date": "2020-08-23T18:25:43.511Z", "id": 1}, |
||||||
|
{"sender": "jean-marc@galvanize.com", "recipient": "jane@galvanize.com" , "subject": "Retro meeting", "message": "They were the last people you’d expect to be involved in anything strange or mysterious, because they just didn’thold with such nonsense.", "date": "2020-04-23T18:25:43.511Z", "id": 2}, |
||||||
|
{"sender": "ash@galvanize.com", "recipient": "jane@galvanize.com", "subject": "New employee next week", "message": "Mr. Dursley was the director of a fi rm called Grunnings, whichmade drills. He was a big, beefy man with hardly any neck, although he did have a very large mustache. ", "date": "2019-01-23T18:25:43.511Z", "id": 3}, |
||||||
|
{"sender": "mattias@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Last week's reports", "message": " Mrs. Dursley was thin and blonde and had nearly twice the usual amount of neck, which came in very useful as she spent so much of her time craning over garden fences, spying on the neighbors.", "date": "2020-06-23T18:25:43.511Z", "id": 4}, |
||||||
|
{"sender": "tanner@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Holiday schedule", "message": "The Dursleys had a small son called Dudley and in their opinion there was no finer boy anywhere.", "date": "2020-03-23T18:25:43.511Z", "id": 5}, |
||||||
|
{"sender": "brandon@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Managers meeting", "message": "The Dursleys had everything they wanted, but they also had a secret, and their greatest fear was that somebody would discover it. ", "date": "2020-02-23T18:25:43.511Z", "id": 6}, |
||||||
|
{"sender": "jeff@galvanize.com", "recipient": "jane@galvanize.com", "subject": "1 on 1 meeting", "message": " ey didn’t think they could bear it if anyone found out about thePotters. ", "date": "2020-02-23T18:25:43.511Z", "id": 7}, |
||||||
|
{"sender": "maddie@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Happy hour next Friday!" , "message":" Mrs. Potter was Mrs. Dursley’s sister, but they hadn’t met for several years; in fact, Mrs. Dursley pretended she didn’t have a sister" , "date": "2019-12-23T18:25:43.511Z", "id": 8}, |
||||||
|
{"sender": "becky@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Vacation Request", "message": " e Dursleys shudderedto think what the neighbors would say if the Potters arrived in the street.", "date": "2020-01-23T18:25:43.511Z", "id": 9}, |
||||||
|
{"sender": "jarret@galvanize.com", "recipient": "jane@galvanize.com", "subject": "All hands meeting", "message": " is boy was another good reason for keeping the Potters away; they didn’t want Dudley mixing with a child like that.", "date": "2019-07-23T18:25:43.511Z", "id": 10}, |
||||||
|
{"sender": "rich@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Standup meeting", "message": " e Dursleys knew that the Potters had a small son, too, butthey had never even seen him.", "date": "2020-03-23T18:25:43.511Z", "id": 11}, |
||||||
|
{"sender": "erin@galvanize.com", "recipient": "jane@galvanize.com", "subject": "New hire orientation assistance needed", "message": "When Mr. and Mrs. Dursley woke up on the dull, gray Tuesday our story starts, there was nothing about the cloudy sky outside tosuggest that strange and mysterious things would soon be happening all over the country", "date": "2020-04-23T18:25:43.511Z", "id": 12 }, |
||||||
|
{"sender": "charlie@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Expense reports due!", "message": " Mr. Dursley hummed as he picked out his most boring tie for work, and Mrs. Dursley gossiped away happily as she wrestled a screaming Dudley into his high chair.", "date": "2018-05-23T18:25:43.511Z", "id": 13}, |
||||||
|
{"sender": "jacob@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Updated travel policy information", "message": "None of them noticed a large, tawny owl fl utter past the window", "date": "2018-05-23T18:25:43.511Z", "id": 14}, |
||||||
|
{"sender": "louise@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Cat videos", "message": "At half past eight, Mr. Dursley picked up his briefcase, pecked Mrs. Dursley on the cheek, and tried to kiss Dudley good-bye but missed, because Dudley was now having a tantrum and throwing his cereal at the walls. ", "date": "2020-02-23T18:25:43.511Z", "id": 15}, |
||||||
|
{"sender": "ash@galavnize.com", "recipient": "jane@galvanize.com", "subject": "I need help", "message": " “Little tyke,” chortled Mr. Dursley as he left the house. ", "date": "2019-04-23T18:25:43.511Z", "id": 16}, |
||||||
|
{"sender": "ash@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Blocked on React issue", "message": "He got into his car and backed out of number four’s drive", "date": "2020-03-23T18:25:43.511Z", "id": 17}, |
||||||
|
{"sender": "katie@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Happy hour this Thursday!", "message": "It was on the corner of the street that he noticed the fi rst sign of something peculiar — a cat reading a map", "date": "2020-03-23T18:25:43.511Z", "id": 18}, |
||||||
|
{"sender": "brandon@galvanize.com", "recipient": "jane@galvanize.com", "subject": "Standup Notes", "message": "For a second, Mr. Dursley didn’t realize what he had seen — then he jerked his head around to look again.", "date": "2020-03-23T18:25:43.511Z", "id": 19} |
||||||
|
] |
@ -0,0 +1,23 @@ |
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. |
||||||
|
|
||||||
|
# dependencies |
||||||
|
/node_modules |
||||||
|
/.pnp |
||||||
|
.pnp.js |
||||||
|
|
||||||
|
# testing |
||||||
|
/coverage |
||||||
|
|
||||||
|
# production |
||||||
|
/build |
||||||
|
|
||||||
|
# misc |
||||||
|
.DS_Store |
||||||
|
.env.local |
||||||
|
.env.development.local |
||||||
|
.env.test.local |
||||||
|
.env.production.local |
||||||
|
|
||||||
|
npm-debug.log* |
||||||
|
yarn-debug.log* |
||||||
|
yarn-error.log* |
@ -0,0 +1,68 @@ |
|||||||
|
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
||||||
|
|
||||||
|
## Available Scripts |
||||||
|
|
||||||
|
In the project directory, you can run: |
||||||
|
|
||||||
|
### `npm start` |
||||||
|
|
||||||
|
Runs the app in the development mode.<br /> |
||||||
|
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
||||||
|
|
||||||
|
The page will reload if you make edits.<br /> |
||||||
|
You will also see any lint errors in the console. |
||||||
|
|
||||||
|
### `npm test` |
||||||
|
|
||||||
|
Launches the test runner in the interactive watch mode.<br /> |
||||||
|
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
||||||
|
|
||||||
|
### `npm run build` |
||||||
|
|
||||||
|
Builds the app for production to the `build` folder.<br /> |
||||||
|
It correctly bundles React in production mode and optimizes the build for the best performance. |
||||||
|
|
||||||
|
The build is minified and the filenames include the hashes.<br /> |
||||||
|
Your app is ready to be deployed! |
||||||
|
|
||||||
|
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
||||||
|
|
||||||
|
### `npm run eject` |
||||||
|
|
||||||
|
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
||||||
|
|
||||||
|
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. |
||||||
|
|
||||||
|
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. |
||||||
|
|
||||||
|
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. |
||||||
|
|
||||||
|
## Learn More |
||||||
|
|
||||||
|
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
||||||
|
|
||||||
|
To learn React, check out the [React documentation](https://reactjs.org/). |
||||||
|
|
||||||
|
### Code Splitting |
||||||
|
|
||||||
|
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting |
||||||
|
|
||||||
|
### Analyzing the Bundle Size |
||||||
|
|
||||||
|
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size |
||||||
|
|
||||||
|
### Making a Progressive Web App |
||||||
|
|
||||||
|
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app |
||||||
|
|
||||||
|
### Advanced Configuration |
||||||
|
|
||||||
|
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration |
||||||
|
|
||||||
|
### Deployment |
||||||
|
|
||||||
|
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment |
||||||
|
|
||||||
|
### `npm run build` fails to minify |
||||||
|
|
||||||
|
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,34 @@ |
|||||||
|
{ |
||||||
|
"name": "mock-gmail", |
||||||
|
"version": "0.1.0", |
||||||
|
"private": true, |
||||||
|
"dependencies": { |
||||||
|
"@testing-library/jest-dom": "^4.2.4", |
||||||
|
"@testing-library/react": "^9.5.0", |
||||||
|
"@testing-library/user-event": "^7.2.1", |
||||||
|
"react": "^16.13.1", |
||||||
|
"react-dom": "^16.13.1", |
||||||
|
"react-scripts": "3.4.1" |
||||||
|
}, |
||||||
|
"scripts": { |
||||||
|
"start": "react-scripts start", |
||||||
|
"build": "react-scripts build", |
||||||
|
"test": "react-scripts test", |
||||||
|
"eject": "react-scripts eject" |
||||||
|
}, |
||||||
|
"eslintConfig": { |
||||||
|
"extends": "react-app" |
||||||
|
}, |
||||||
|
"browserslist": { |
||||||
|
"production": [ |
||||||
|
">0.2%", |
||||||
|
"not dead", |
||||||
|
"not op_mini all" |
||||||
|
], |
||||||
|
"development": [ |
||||||
|
"last 1 chrome version", |
||||||
|
"last 1 firefox version", |
||||||
|
"last 1 safari version" |
||||||
|
] |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 3.1 KiB |
@ -0,0 +1,44 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8" /> |
||||||
|
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
||||||
|
<meta name="theme-color" content="#000000" /> |
||||||
|
<meta |
||||||
|
name="description" |
||||||
|
content="Web site created using create-react-app" |
||||||
|
/> |
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> |
||||||
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> |
||||||
|
<!-- |
||||||
|
manifest.json provides metadata used when your web app is installed on a |
||||||
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ |
||||||
|
--> |
||||||
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> |
||||||
|
<!-- |
||||||
|
Notice the use of %PUBLIC_URL% in the tags above. |
||||||
|
It will be replaced with the URL of the `public` folder during the build. |
||||||
|
Only files inside the `public` folder can be referenced from the HTML. |
||||||
|
|
||||||
|
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will |
||||||
|
work correctly both with client-side routing and a non-root public URL. |
||||||
|
Learn how to configure a non-root public URL by running `npm run build`. |
||||||
|
--> |
||||||
|
<title>React App</title> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<noscript>You need to enable JavaScript to run this app.</noscript> |
||||||
|
<div id="root"></div> |
||||||
|
<!-- |
||||||
|
This HTML file is a template. |
||||||
|
If you open it directly in the browser, you will see an empty page. |
||||||
|
|
||||||
|
You can add webfonts, meta tags, or analytics to this file. |
||||||
|
The build step will place the bundled scripts into the <body> tag. |
||||||
|
|
||||||
|
To begin the development, run `npm start` or `yarn start`. |
||||||
|
To create a production bundle, use `npm run build` or `yarn build`. |
||||||
|
--> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 9.4 KiB |
@ -0,0 +1,25 @@ |
|||||||
|
{ |
||||||
|
"short_name": "React App", |
||||||
|
"name": "Create React App Sample", |
||||||
|
"icons": [ |
||||||
|
{ |
||||||
|
"src": "favicon.ico", |
||||||
|
"sizes": "64x64 32x32 24x24 16x16", |
||||||
|
"type": "image/x-icon" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "logo192.png", |
||||||
|
"type": "image/png", |
||||||
|
"sizes": "192x192" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"src": "logo512.png", |
||||||
|
"type": "image/png", |
||||||
|
"sizes": "512x512" |
||||||
|
} |
||||||
|
], |
||||||
|
"start_url": ".", |
||||||
|
"display": "standalone", |
||||||
|
"theme_color": "#000000", |
||||||
|
"background_color": "#ffffff" |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
# https://www.robotstxt.org/robotstxt.html |
||||||
|
User-agent: * |
||||||
|
Disallow: |
@ -0,0 +1,90 @@ |
|||||||
|
.App { |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
|
||||||
|
body{ |
||||||
|
background-color:#000000; |
||||||
|
color: #99CC99; |
||||||
|
font-family: 'Courier New',sans-serif |
||||||
|
} |
||||||
|
|
||||||
|
input{ |
||||||
|
background-color:#333333; |
||||||
|
margin:4px; |
||||||
|
max-width:480px; |
||||||
|
width:100%; |
||||||
|
height:32px; |
||||||
|
border:1px #CCCCCC solid; |
||||||
|
color:#99CC99; |
||||||
|
font-size:32px; |
||||||
|
font-weight:bold; |
||||||
|
} |
||||||
|
|
||||||
|
.verylarge{ |
||||||
|
background-color:#333333; |
||||||
|
color:#99CC99; |
||||||
|
width:960px; |
||||||
|
} |
||||||
|
|
||||||
|
hr{ |
||||||
|
background-color:#999999; |
||||||
|
} |
||||||
|
|
||||||
|
.centered{ |
||||||
|
margin:auto; |
||||||
|
} |
||||||
|
|
||||||
|
.header{ |
||||||
|
font-weight:bold; |
||||||
|
background-color:#222222; |
||||||
|
font-size:24px; |
||||||
|
border: 1px #66AA66 solid; |
||||||
|
} |
||||||
|
|
||||||
|
button{ |
||||||
|
background-color:#333333; |
||||||
|
border:1px #CCCCCC solid; |
||||||
|
color:#99CC99; |
||||||
|
font-size:26px; |
||||||
|
font-weight:bold; |
||||||
|
} |
||||||
|
|
||||||
|
.link:hover{ |
||||||
|
background-color:#666666; |
||||||
|
cursor:pointer; |
||||||
|
} |
||||||
|
|
||||||
|
.App-logo { |
||||||
|
height: 40vmin; |
||||||
|
pointer-events: none; |
||||||
|
} |
||||||
|
|
||||||
|
@media (prefers-reduced-motion: no-preference) { |
||||||
|
.App-logo { |
||||||
|
animation: App-logo-spin infinite 20s linear; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.App-header { |
||||||
|
background-color: #282c34; |
||||||
|
min-height: 100vh; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
font-size: calc(10px + 2vmin); |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
.App-link { |
||||||
|
color: #61dafb; |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes App-logo-spin { |
||||||
|
from { |
||||||
|
transform: rotate(0deg); |
||||||
|
} |
||||||
|
to { |
||||||
|
transform: rotate(360deg); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,253 @@ |
|||||||
|
import React, { useState, useEffect } from 'react'; |
||||||
|
import logo from './logo.svg'; |
||||||
|
import './App.css'; |
||||||
|
|
||||||
|
function App() { |
||||||
|
const [emails,setEmails] = useState([]) |
||||||
|
const [outgoing,setOutgoing] = useState([]) |
||||||
|
const [error, setError] = useState(null); |
||||||
|
const [isLoaded, setIsLoaded] = useState(false); |
||||||
|
const [emailView, setemailView] = useState("Sending..."); |
||||||
|
const [searchFilter, setsearchFilter] = useState(""); |
||||||
|
const [response, setResponse] = useState(0); |
||||||
|
const [func, getFunction] = useState(sendMessage); |
||||||
|
const [pageView, setpageView] = useState("HOME"); |
||||||
|
const [sort, setSort] = useState(false); |
||||||
|
const [url,setUrl] = useState("http://localhost:3001/emails") |
||||||
|
const [outgoingurl,setoutgoingUrl] = useState("http://localhost:3001/emails/search") |
||||||
|
useEffect(()=>{fetch(url).then(res=>res.json()).then( |
||||||
|
(result)=>{ |
||||||
|
setIsLoaded(true); |
||||||
|
console.log(result) |
||||||
|
setEmails(result) |
||||||
|
},(error)=>{ |
||||||
|
setIsLoaded(true); |
||||||
|
setError(error); |
||||||
|
} |
||||||
|
) |
||||||
|
},[url]) |
||||||
|
|
||||||
|
var searchSubject = (filter,page) => { |
||||||
|
filter(document.getElementById("search").value); |
||||||
|
page("FILTERED"); |
||||||
|
} |
||||||
|
|
||||||
|
var sortByDate = (sort,sortval) => { |
||||||
|
sort(!sortval) |
||||||
|
console.log("sort is now "+sortval) |
||||||
|
} |
||||||
|
|
||||||
|
var displaySidebar = () => { |
||||||
|
return ( |
||||||
|
<React.Fragment> |
||||||
|
<input id="search" type="text"/> |
||||||
|
<button className="link" onClick={()=>{searchSubject(setsearchFilter,setpageView)}}>Submit</button> |
||||||
|
</React.Fragment> |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
var sendMessage = (main,page) => { |
||||||
|
main("Sending email..."); |
||||||
|
fetch("http://localhost:3001/send", { |
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json; charset=UTF-8" |
||||||
|
} , |
||||||
|
body: JSON.stringify({sender:document.getElementById("from").value,recipient:document.getElementById("name").value,subject:document.getElementById("subject").value,message:document.getElementById("message").value}) |
||||||
|
}).then(res => { |
||||||
|
page("SENTEMAIL") |
||||||
|
console.log("Request complete! response:", res); |
||||||
|
return res.json(); |
||||||
|
}).then((result)=>{ |
||||||
|
var finalMessage=(<React.Fragment><h2>{result.status[0].toUpperCase()+result.status.slice(1)+"!"}</h2>{result.message}</React.Fragment>); |
||||||
|
main(finalMessage)} |
||||||
|
); |
||||||
|
} |
||||||
|
|
||||||
|
var displayContent = () => {switch (pageView) { |
||||||
|
case "HOME":{ |
||||||
|
return ( |
||||||
|
<React.Fragment> |
||||||
|
<div className="row"> |
||||||
|
<div className="col-2 header"> |
||||||
|
Sender |
||||||
|
</div> |
||||||
|
<div className="col-3 header"> |
||||||
|
Subject |
||||||
|
</div> |
||||||
|
<div className="col-5 header"> |
||||||
|
Message |
||||||
|
</div> |
||||||
|
<div className="col-2 header link" onClick={()=>{sortByDate(setSort,sort)}}> |
||||||
|
Date |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{emails.sort((email1,email2)=>(sort)?Date.parse(email1.date)>Date.parse(email2.date):false).map((email,id)=> |
||||||
|
(<React.Fragment> |
||||||
|
|
||||||
|
<div className="row mt-0 mb-0 pt-0 pb-0 link" onClick={()=>{setemailView(id);setpageView("INDIVIDUAL")}}> |
||||||
|
<div className="col-2 text-nowrap overflow-hidden"> |
||||||
|
{email.sender} |
||||||
|
</div> |
||||||
|
<div className="col-3 text-nowrap overflow-hidden"> |
||||||
|
{email.subject} |
||||||
|
</div> |
||||||
|
<div className="col-5 text-nowrap overflow-hidden"> |
||||||
|
{email.message} |
||||||
|
</div> |
||||||
|
<div className="col-2 text-nowrap overflow-hidden"> |
||||||
|
{email.date} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</React.Fragment>) |
||||||
|
)} |
||||||
|
</React.Fragment> |
||||||
|
) |
||||||
|
} |
||||||
|
case "INDIVIDUAL":{ |
||||||
|
return( |
||||||
|
<React.Fragment> |
||||||
|
<h2>{emails[emailView].subject}</h2> |
||||||
|
<h4><b>To: </b>{emails[emailView].recipient}</h4> |
||||||
|
<h4><b>From: </b>{emails[emailView].sender}</h4> |
||||||
|
<h4><b>Sent on: </b>{emails[emailView].date}</h4> |
||||||
|
<hr/> |
||||||
|
{emails[emailView].message} |
||||||
|
</React.Fragment> |
||||||
|
); |
||||||
|
}break; |
||||||
|
case "SENDEMAIL":{ |
||||||
|
return(<React.Fragment> |
||||||
|
<h2>Compose a New Email</h2> |
||||||
|
<h4><b>To: </b><input id="name" type="text"/></h4> |
||||||
|
<h4><b>From: </b><input id="from" type="text"/></h4> |
||||||
|
<h4><b>Subject: </b><input id="subject" type="text"/></h4> |
||||||
|
<hr/> |
||||||
|
<textarea className="verylarge" id="message" type="text" rows="10" cols="86" /> |
||||||
|
<button className="link" onClick={()=>{sendMessage(setResponse,setpageView)}}>Send</button> |
||||||
|
</React.Fragment>) |
||||||
|
} |
||||||
|
case "SENTEMAIL":{ |
||||||
|
return(<React.Fragment> |
||||||
|
{response} |
||||||
|
</React.Fragment>); |
||||||
|
}break; |
||||||
|
case "FILTERED":{ |
||||||
|
return ( |
||||||
|
<React.Fragment> |
||||||
|
<div className="row"> |
||||||
|
<div className="col-2 header"> |
||||||
|
Sender |
||||||
|
</div> |
||||||
|
<div className="col-3 header"> |
||||||
|
Subject |
||||||
|
</div> |
||||||
|
<div className="col-5 header"> |
||||||
|
Message |
||||||
|
</div> |
||||||
|
<div className="col-2 header link" onClick={()=>{sortByDate(setSort,sort)}}> |
||||||
|
Date |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{emails.sort((email1,email2)=>(sort)?Date.parse(email1.date)>Date.parse(email2.date):false).filter((email)=>email.subject.includes(searchFilter)).map((email,id)=> |
||||||
|
(<React.Fragment> |
||||||
|
|
||||||
|
<div className="row mt-0 mb-0 pt-0 pb-0 link" onClick={()=>{setemailView(id);setpageView("INDIVIDUAL")}}> |
||||||
|
<div className="col-2 text-nowrap overflow-hidden"> |
||||||
|
{email.sender} |
||||||
|
</div> |
||||||
|
<div className="col-3 text-nowrap overflow-hidden"> |
||||||
|
{email.subject} |
||||||
|
</div> |
||||||
|
<div className="col-5 text-nowrap overflow-hidden"> |
||||||
|
{email.message} |
||||||
|
</div> |
||||||
|
<div className="col-2 text-nowrap overflow-hidden"> |
||||||
|
{email.date} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</React.Fragment>) |
||||||
|
)} |
||||||
|
</React.Fragment> |
||||||
|
) |
||||||
|
}break; |
||||||
|
case "SORTBYDATE":{ |
||||||
|
return ( |
||||||
|
<React.Fragment> |
||||||
|
<div className="row"> |
||||||
|
<div className="col-2 header"> |
||||||
|
Sender |
||||||
|
</div> |
||||||
|
<div className="col-3 header"> |
||||||
|
Subject |
||||||
|
</div> |
||||||
|
<div className="col-5 header"> |
||||||
|
Message |
||||||
|
</div> |
||||||
|
<div className="col-2 header link" onClick={()=>{sortByDate(setSort,sort)}}> |
||||||
|
Date |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
{emails.sort((email1,email2)=>(sort)?Date.parse(email1.date)>Date.parse(email2.date):false).map((email,id)=> |
||||||
|
(<React.Fragment> |
||||||
|
|
||||||
|
<div className="row mt-0 mb-0 pt-0 pb-0 link" onClick={()=>{setemailView(id);setpageView("INDIVIDUAL")}}> |
||||||
|
<div className="col-2 text-nowrap overflow-hidden"> |
||||||
|
{email.sender} |
||||||
|
</div> |
||||||
|
<div className="col-3 text-nowrap overflow-hidden"> |
||||||
|
{email.subject} |
||||||
|
</div> |
||||||
|
<div className="col-5 text-nowrap overflow-hidden"> |
||||||
|
{email.message} |
||||||
|
</div> |
||||||
|
<div className="col-2 text-nowrap overflow-hidden"> |
||||||
|
{email.date} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</React.Fragment>) |
||||||
|
)} |
||||||
|
</React.Fragment> |
||||||
|
) |
||||||
|
}break; |
||||||
|
default:{ |
||||||
|
return( |
||||||
|
<div>???</div> |
||||||
|
) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (error) { |
||||||
|
return <div>Error: {error.message}</div>; |
||||||
|
} else if (!isLoaded) { |
||||||
|
return <div>Loading...</div>; |
||||||
|
} else if (emails.length === 0) { |
||||||
|
return <div>No data</div>; |
||||||
|
} else { |
||||||
|
return ( |
||||||
|
<React.Fragment> |
||||||
|
<div className="container-fluid"> |
||||||
|
<div className="row mt-1"> |
||||||
|
<div className="col-md-3"><img src="https://snipboard.io/V9jJTf.jpg"/></div> |
||||||
|
<div className="col-md-9">{displaySidebar()}</div> |
||||||
|
</div> |
||||||
|
<hr/> |
||||||
|
<div className="row"> |
||||||
|
<div className="col-md-2 sidebar"> |
||||||
|
<div className="sidebar_link centered link mt-4 mb-4" onClick={()=>{setpageView("SENDEMAIL")}}>+ COMPOSE</div> |
||||||
|
<div className="sidebar_link link" onClick={()=>{setpageView("HOME")}}>Inbox ({emails.length})</div> |
||||||
|
<div className="sidebar_link link">Sent Items ({outgoing.length})</div> |
||||||
|
</div> |
||||||
|
<hr/> |
||||||
|
<div className="col-md-10"> |
||||||
|
{displayContent()} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</React.Fragment> |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export default App; |
@ -0,0 +1,9 @@ |
|||||||
|
import React from 'react'; |
||||||
|
import { render } from '@testing-library/react'; |
||||||
|
import App from './App'; |
||||||
|
|
||||||
|
test('renders learn react link', () => { |
||||||
|
const { getByText } = render(<App />); |
||||||
|
const linkElement = getByText(/learn react/i); |
||||||
|
expect(linkElement).toBeInTheDocument(); |
||||||
|
}); |
@ -0,0 +1,13 @@ |
|||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', |
||||||
|
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', |
||||||
|
sans-serif; |
||||||
|
-webkit-font-smoothing: antialiased; |
||||||
|
-moz-osx-font-smoothing: grayscale; |
||||||
|
} |
||||||
|
|
||||||
|
code { |
||||||
|
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', |
||||||
|
monospace; |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
import React from 'react'; |
||||||
|
import ReactDOM from 'react-dom'; |
||||||
|
import './index.css'; |
||||||
|
import App from './App'; |
||||||
|
import * as serviceWorker from './serviceWorker'; |
||||||
|
|
||||||
|
ReactDOM.render( |
||||||
|
<React.StrictMode> |
||||||
|
<App /> |
||||||
|
</React.StrictMode>, |
||||||
|
document.getElementById('root') |
||||||
|
); |
||||||
|
|
||||||
|
// 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(); |
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,141 @@ |
|||||||
|
// This optional code is used to register a service worker.
|
||||||
|
// register() is not called by default.
|
||||||
|
|
||||||
|
// This lets the app load faster on subsequent visits in production, and gives
|
||||||
|
// it offline capabilities. However, it also means that developers (and users)
|
||||||
|
// will only see deployed updates on subsequent visits to a page, after all the
|
||||||
|
// existing tabs open on the page have been closed, since previously cached
|
||||||
|
// resources are updated in the background.
|
||||||
|
|
||||||
|
// To learn more about the benefits of this model and instructions on how to
|
||||||
|
// opt-in, read https://bit.ly/CRA-PWA
|
||||||
|
|
||||||
|
const isLocalhost = Boolean( |
||||||
|
window.location.hostname === 'localhost' || |
||||||
|
// [::1] is the IPv6 localhost address.
|
||||||
|
window.location.hostname === '[::1]' || |
||||||
|
// 127.0.0.0/8 are considered localhost for IPv4.
|
||||||
|
window.location.hostname.match( |
||||||
|
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ |
||||||
|
) |
||||||
|
); |
||||||
|
|
||||||
|
export function register(config) { |
||||||
|
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { |
||||||
|
// The URL constructor is available in all browsers that support SW.
|
||||||
|
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); |
||||||
|
if (publicUrl.origin !== window.location.origin) { |
||||||
|
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||||
|
// from what our page is served on. This might happen if a CDN is used to
|
||||||
|
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
window.addEventListener('load', () => { |
||||||
|
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; |
||||||
|
|
||||||
|
if (isLocalhost) { |
||||||
|
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||||
|
checkValidServiceWorker(swUrl, config); |
||||||
|
|
||||||
|
// Add some additional logging to localhost, pointing developers to the
|
||||||
|
// service worker/PWA documentation.
|
||||||
|
navigator.serviceWorker.ready.then(() => { |
||||||
|
console.log( |
||||||
|
'This web app is being served cache-first by a service ' + |
||||||
|
'worker. To learn more, visit https://bit.ly/CRA-PWA' |
||||||
|
); |
||||||
|
}); |
||||||
|
} else { |
||||||
|
// Is not localhost. Just register service worker
|
||||||
|
registerValidSW(swUrl, config); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
function registerValidSW(swUrl, config) { |
||||||
|
navigator.serviceWorker |
||||||
|
.register(swUrl) |
||||||
|
.then(registration => { |
||||||
|
registration.onupdatefound = () => { |
||||||
|
const installingWorker = registration.installing; |
||||||
|
if (installingWorker == null) { |
||||||
|
return; |
||||||
|
} |
||||||
|
installingWorker.onstatechange = () => { |
||||||
|
if (installingWorker.state === 'installed') { |
||||||
|
if (navigator.serviceWorker.controller) { |
||||||
|
// At this point, the updated precached content has been fetched,
|
||||||
|
// but the previous service worker will still serve the older
|
||||||
|
// content until all client tabs are closed.
|
||||||
|
console.log( |
||||||
|
'New content is available and will be used when all ' + |
||||||
|
'tabs for this page are closed. See https://bit.ly/CRA-PWA.' |
||||||
|
); |
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config && config.onUpdate) { |
||||||
|
config.onUpdate(registration); |
||||||
|
} |
||||||
|
} else { |
||||||
|
// At this point, everything has been precached.
|
||||||
|
// It's the perfect time to display a
|
||||||
|
// "Content is cached for offline use." message.
|
||||||
|
console.log('Content is cached for offline use.'); |
||||||
|
|
||||||
|
// Execute callback
|
||||||
|
if (config && config.onSuccess) { |
||||||
|
config.onSuccess(registration); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}; |
||||||
|
}; |
||||||
|
}) |
||||||
|
.catch(error => { |
||||||
|
console.error('Error during service worker registration:', error); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
function checkValidServiceWorker(swUrl, config) { |
||||||
|
// Check if the service worker can be found. If it can't reload the page.
|
||||||
|
fetch(swUrl, { |
||||||
|
headers: { 'Service-Worker': 'script' }, |
||||||
|
}) |
||||||
|
.then(response => { |
||||||
|
// Ensure service worker exists, and that we really are getting a JS file.
|
||||||
|
const contentType = response.headers.get('content-type'); |
||||||
|
if ( |
||||||
|
response.status === 404 || |
||||||
|
(contentType != null && contentType.indexOf('javascript') === -1) |
||||||
|
) { |
||||||
|
// No service worker found. Probably a different app. Reload the page.
|
||||||
|
navigator.serviceWorker.ready.then(registration => { |
||||||
|
registration.unregister().then(() => { |
||||||
|
window.location.reload(); |
||||||
|
}); |
||||||
|
}); |
||||||
|
} else { |
||||||
|
// Service worker found. Proceed as normal.
|
||||||
|
registerValidSW(swUrl, config); |
||||||
|
} |
||||||
|
}) |
||||||
|
.catch(() => { |
||||||
|
console.log( |
||||||
|
'No internet connection found. App is running in offline mode.' |
||||||
|
); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
export function unregister() { |
||||||
|
if ('serviceWorker' in navigator) { |
||||||
|
navigator.serviceWorker.ready |
||||||
|
.then(registration => { |
||||||
|
registration.unregister(); |
||||||
|
}) |
||||||
|
.catch(error => { |
||||||
|
console.error(error.message); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
// 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'; |
@ -0,0 +1,374 @@ |
|||||||
|
{ |
||||||
|
"name": "server", |
||||||
|
"version": "1.0.0", |
||||||
|
"lockfileVersion": 1, |
||||||
|
"requires": true, |
||||||
|
"dependencies": { |
||||||
|
"accepts": { |
||||||
|
"version": "1.3.7", |
||||||
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", |
||||||
|
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", |
||||||
|
"requires": { |
||||||
|
"mime-types": "~2.1.24", |
||||||
|
"negotiator": "0.6.2" |
||||||
|
} |
||||||
|
}, |
||||||
|
"array-flatten": { |
||||||
|
"version": "1.1.1", |
||||||
|
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", |
||||||
|
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" |
||||||
|
}, |
||||||
|
"body-parser": { |
||||||
|
"version": "1.19.0", |
||||||
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", |
||||||
|
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", |
||||||
|
"requires": { |
||||||
|
"bytes": "3.1.0", |
||||||
|
"content-type": "~1.0.4", |
||||||
|
"debug": "2.6.9", |
||||||
|
"depd": "~1.1.2", |
||||||
|
"http-errors": "1.7.2", |
||||||
|
"iconv-lite": "0.4.24", |
||||||
|
"on-finished": "~2.3.0", |
||||||
|
"qs": "6.7.0", |
||||||
|
"raw-body": "2.4.0", |
||||||
|
"type-is": "~1.6.17" |
||||||
|
} |
||||||
|
}, |
||||||
|
"bytes": { |
||||||
|
"version": "3.1.0", |
||||||
|
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", |
||||||
|
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" |
||||||
|
}, |
||||||
|
"content-disposition": { |
||||||
|
"version": "0.5.3", |
||||||
|
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", |
||||||
|
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", |
||||||
|
"requires": { |
||||||
|
"safe-buffer": "5.1.2" |
||||||
|
} |
||||||
|
}, |
||||||
|
"content-type": { |
||||||
|
"version": "1.0.4", |
||||||
|
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", |
||||||
|
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" |
||||||
|
}, |
||||||
|
"cookie": { |
||||||
|
"version": "0.4.0", |
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", |
||||||
|
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" |
||||||
|
}, |
||||||
|
"cookie-signature": { |
||||||
|
"version": "1.0.6", |
||||||
|
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", |
||||||
|
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" |
||||||
|
}, |
||||||
|
"debug": { |
||||||
|
"version": "2.6.9", |
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", |
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", |
||||||
|
"requires": { |
||||||
|
"ms": "2.0.0" |
||||||
|
} |
||||||
|
}, |
||||||
|
"depd": { |
||||||
|
"version": "1.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", |
||||||
|
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" |
||||||
|
}, |
||||||
|
"destroy": { |
||||||
|
"version": "1.0.4", |
||||||
|
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", |
||||||
|
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" |
||||||
|
}, |
||||||
|
"ee-first": { |
||||||
|
"version": "1.1.1", |
||||||
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", |
||||||
|
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" |
||||||
|
}, |
||||||
|
"encodeurl": { |
||||||
|
"version": "1.0.2", |
||||||
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", |
||||||
|
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" |
||||||
|
}, |
||||||
|
"escape-html": { |
||||||
|
"version": "1.0.3", |
||||||
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", |
||||||
|
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" |
||||||
|
}, |
||||||
|
"etag": { |
||||||
|
"version": "1.8.1", |
||||||
|
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", |
||||||
|
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" |
||||||
|
}, |
||||||
|
"express": { |
||||||
|
"version": "4.17.1", |
||||||
|
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", |
||||||
|
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", |
||||||
|
"requires": { |
||||||
|
"accepts": "~1.3.7", |
||||||
|
"array-flatten": "1.1.1", |
||||||
|
"body-parser": "1.19.0", |
||||||
|
"content-disposition": "0.5.3", |
||||||
|
"content-type": "~1.0.4", |
||||||
|
"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.5", |
||||||
|
"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" |
||||||
|
} |
||||||
|
}, |
||||||
|
"finalhandler": { |
||||||
|
"version": "1.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", |
||||||
|
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", |
||||||
|
"requires": { |
||||||
|
"debug": "2.6.9", |
||||||
|
"encodeurl": "~1.0.2", |
||||||
|
"escape-html": "~1.0.3", |
||||||
|
"on-finished": "~2.3.0", |
||||||
|
"parseurl": "~1.3.3", |
||||||
|
"statuses": "~1.5.0", |
||||||
|
"unpipe": "~1.0.0" |
||||||
|
} |
||||||
|
}, |
||||||
|
"forwarded": { |
||||||
|
"version": "0.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", |
||||||
|
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" |
||||||
|
}, |
||||||
|
"fresh": { |
||||||
|
"version": "0.5.2", |
||||||
|
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", |
||||||
|
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" |
||||||
|
}, |
||||||
|
"http-errors": { |
||||||
|
"version": "1.7.2", |
||||||
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", |
||||||
|
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", |
||||||
|
"requires": { |
||||||
|
"depd": "~1.1.2", |
||||||
|
"inherits": "2.0.3", |
||||||
|
"setprototypeof": "1.1.1", |
||||||
|
"statuses": ">= 1.5.0 < 2", |
||||||
|
"toidentifier": "1.0.0" |
||||||
|
} |
||||||
|
}, |
||||||
|
"iconv-lite": { |
||||||
|
"version": "0.4.24", |
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", |
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", |
||||||
|
"requires": { |
||||||
|
"safer-buffer": ">= 2.1.2 < 3" |
||||||
|
} |
||||||
|
}, |
||||||
|
"inherits": { |
||||||
|
"version": "2.0.3", |
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", |
||||||
|
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" |
||||||
|
}, |
||||||
|
"ipaddr.js": { |
||||||
|
"version": "1.9.1", |
||||||
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", |
||||||
|
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" |
||||||
|
}, |
||||||
|
"media-typer": { |
||||||
|
"version": "0.3.0", |
||||||
|
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", |
||||||
|
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" |
||||||
|
}, |
||||||
|
"merge-descriptors": { |
||||||
|
"version": "1.0.1", |
||||||
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", |
||||||
|
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" |
||||||
|
}, |
||||||
|
"methods": { |
||||||
|
"version": "1.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", |
||||||
|
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" |
||||||
|
}, |
||||||
|
"mime": { |
||||||
|
"version": "1.6.0", |
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", |
||||||
|
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" |
||||||
|
}, |
||||||
|
"mime-db": { |
||||||
|
"version": "1.43.0", |
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", |
||||||
|
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" |
||||||
|
}, |
||||||
|
"mime-types": { |
||||||
|
"version": "2.1.26", |
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", |
||||||
|
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", |
||||||
|
"requires": { |
||||||
|
"mime-db": "1.43.0" |
||||||
|
} |
||||||
|
}, |
||||||
|
"ms": { |
||||||
|
"version": "2.0.0", |
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", |
||||||
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" |
||||||
|
}, |
||||||
|
"negotiator": { |
||||||
|
"version": "0.6.2", |
||||||
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", |
||||||
|
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" |
||||||
|
}, |
||||||
|
"on-finished": { |
||||||
|
"version": "2.3.0", |
||||||
|
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", |
||||||
|
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", |
||||||
|
"requires": { |
||||||
|
"ee-first": "1.1.1" |
||||||
|
} |
||||||
|
}, |
||||||
|
"parseurl": { |
||||||
|
"version": "1.3.3", |
||||||
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", |
||||||
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" |
||||||
|
}, |
||||||
|
"path-to-regexp": { |
||||||
|
"version": "0.1.7", |
||||||
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", |
||||||
|
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" |
||||||
|
}, |
||||||
|
"proxy-addr": { |
||||||
|
"version": "2.0.6", |
||||||
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", |
||||||
|
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", |
||||||
|
"requires": { |
||||||
|
"forwarded": "~0.1.2", |
||||||
|
"ipaddr.js": "1.9.1" |
||||||
|
} |
||||||
|
}, |
||||||
|
"qs": { |
||||||
|
"version": "6.7.0", |
||||||
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", |
||||||
|
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" |
||||||
|
}, |
||||||
|
"range-parser": { |
||||||
|
"version": "1.2.1", |
||||||
|
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", |
||||||
|
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" |
||||||
|
}, |
||||||
|
"raw-body": { |
||||||
|
"version": "2.4.0", |
||||||
|
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", |
||||||
|
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", |
||||||
|
"requires": { |
||||||
|
"bytes": "3.1.0", |
||||||
|
"http-errors": "1.7.2", |
||||||
|
"iconv-lite": "0.4.24", |
||||||
|
"unpipe": "1.0.0" |
||||||
|
} |
||||||
|
}, |
||||||
|
"safe-buffer": { |
||||||
|
"version": "5.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", |
||||||
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" |
||||||
|
}, |
||||||
|
"safer-buffer": { |
||||||
|
"version": "2.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", |
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" |
||||||
|
}, |
||||||
|
"send": { |
||||||
|
"version": "0.17.1", |
||||||
|
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", |
||||||
|
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", |
||||||
|
"requires": { |
||||||
|
"debug": "2.6.9", |
||||||
|
"depd": "~1.1.2", |
||||||
|
"destroy": "~1.0.4", |
||||||
|
"encodeurl": "~1.0.2", |
||||||
|
"escape-html": "~1.0.3", |
||||||
|
"etag": "~1.8.1", |
||||||
|
"fresh": "0.5.2", |
||||||
|
"http-errors": "~1.7.2", |
||||||
|
"mime": "1.6.0", |
||||||
|
"ms": "2.1.1", |
||||||
|
"on-finished": "~2.3.0", |
||||||
|
"range-parser": "~1.2.1", |
||||||
|
"statuses": "~1.5.0" |
||||||
|
}, |
||||||
|
"dependencies": { |
||||||
|
"ms": { |
||||||
|
"version": "2.1.1", |
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", |
||||||
|
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
"serve-static": { |
||||||
|
"version": "1.14.1", |
||||||
|
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", |
||||||
|
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", |
||||||
|
"requires": { |
||||||
|
"encodeurl": "~1.0.2", |
||||||
|
"escape-html": "~1.0.3", |
||||||
|
"parseurl": "~1.3.3", |
||||||
|
"send": "0.17.1" |
||||||
|
} |
||||||
|
}, |
||||||
|
"setprototypeof": { |
||||||
|
"version": "1.1.1", |
||||||
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", |
||||||
|
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" |
||||||
|
}, |
||||||
|
"statuses": { |
||||||
|
"version": "1.5.0", |
||||||
|
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", |
||||||
|
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" |
||||||
|
}, |
||||||
|
"toidentifier": { |
||||||
|
"version": "1.0.0", |
||||||
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", |
||||||
|
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" |
||||||
|
}, |
||||||
|
"type-is": { |
||||||
|
"version": "1.6.18", |
||||||
|
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", |
||||||
|
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", |
||||||
|
"requires": { |
||||||
|
"media-typer": "0.3.0", |
||||||
|
"mime-types": "~2.1.24" |
||||||
|
} |
||||||
|
}, |
||||||
|
"unpipe": { |
||||||
|
"version": "1.0.0", |
||||||
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", |
||||||
|
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" |
||||||
|
}, |
||||||
|
"utils-merge": { |
||||||
|
"version": "1.0.1", |
||||||
|
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", |
||||||
|
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" |
||||||
|
}, |
||||||
|
"vary": { |
||||||
|
"version": "1.1.2", |
||||||
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", |
||||||
|
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
{ |
||||||
|
"name": "server", |
||||||
|
"version": "1.0.0", |
||||||
|
"description": "", |
||||||
|
"main": "index.js", |
||||||
|
"scripts": { |
||||||
|
"start": "node app.js" |
||||||
|
}, |
||||||
|
"author": "", |
||||||
|
"license": "ISC", |
||||||
|
"dependencies": { |
||||||
|
"body-parser": "^1.19.0", |
||||||
|
"express": "^4.17.1" |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue