route: /login method: POST
Request Body
const express = require("express"); | |
const cors = require("cors"); | |
require("dotenv").config(); | |
const app = express(); | |
const { LiveDB } = require("./db"); | |
// Middleware | |
app.use(express.json()); | |
app.use(cors()); |
/** | |
* This React class is intended to query an endpoint that will return an alphanumeric string, after clicking a button. | |
* This component is passed a prop "apiQueryDelay", which delays the endpoint request by N milliseconds. There is a | |
* second button to disable this functionality and have the endpoint request run immediately after button click. | |
* This data is then to be displayed inside a simple container. | |
* The "queryAPI" XHR handler will return the endpoint response in the form of a Promise (such as axios, fetch). | |
* The response object will look like the following: {data: "A0B3HCJ"} | |
* The containing element ref isn't used, but should remain within the class. | |
* Please identify, correct and comment on any errors or bad practices you see in the React component class below. | |
* Additionally, please feel free to change the code style as you see fit. |
import React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
import useInfiniteScroll from "./useInfinite" | |
const Article = () => { | |
const [data, setData] = useState([]); | |
const [page, setPage] = useState(1); | |
const [isFetching, setIsFetching] = useInfiniteScroll(moreData); | |
const loadData = () =>{ |
import { useState, useEffect } from "react"; | |
const useInfiniteScroll = callback => { | |
const [isFetching, setIsFetching] = useState(false); | |
useEffect(() => { | |
window.addEventListener("scroll", isScrolling); | |
return () => window.removeEventListener("scroll", isScrolling); | |
}, []); |
import React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
const Article = () => { | |
const [data, setData] = useState([]); | |
const [page, setPage] = useState(1); | |
const [isFetching, setIsFetching] = useState(false); | |
const loadData = () =>{ |
import React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
const Article = () => { | |
const url = "https://medrum.herokuapp.com/articles"; | |
const [data, setData] = useState([]); | |
useEffect(() => { | |
axios.get(url).then(res => { | |
setData(res.data); | |
}); |
import React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
const Article = () => { | |
const url = "https://medrum.herokuapp.com/articles"; | |
const [data, setData] = useState([]); | |
useEffect(() => { | |
axios.get(url).then(res => { | |
setData(res.data); | |
}); |
import urllib2 | |
import re | |
url = raw_input("Enter a URL: ") | |
#connecting to a URL | |
website = urllib2.urlopen(url) | |
#read html code | |
html = website.read() |
import React, { useState, useEffect } from "react"; | |
import axios from "axios"; | |
const List = () => { | |
const url = "https://medrum.herokuapp.com/articles"; | |
const [data, setData] = useState([]); | |
useEffect(() => { | |
axios.get(url).then(res => { | |
setData(res.data); | |
}); |