I hereby claim:
- I am bhupendra-nitt on github.
- I am bhupendra (https://keybase.io/bhupendra) on keybase.
- I have a public key ASD5JwKJokZqv-olcVtd0P5l-bPjbtIOUWANURna0FjEFgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import React, { useState } from 'react'; | |
const App = () => { | |
const [name, setName ] = useState('') | |
const [age, setAge] = useState('') | |
const [error, validateForm] = useState({}) | |
const handleSubmit = () => { | |
if(!age || !name) { | |
validateForm({message: 'Enter all values'}) |
return ( | |
<div> | |
<div>Name: {name}</div> | |
<div>Age: {age}</div> | |
<input value={name} onChange={(e) => setName(e.target.value)}/> | |
<input value={age} onChange={(e) => setAge(e.target.value)}/> | |
<button onClick={handleSubmit}>Submit</button> | |
<div style={{color: 'red' }}> | |
{error.message} | |
</div> |
const [name, setName ] = useState('') | |
const [age, setAge] = useState('') | |
const [error, validateForm] = useState({}) |
curl 'http://localhost:4400/<url>' | |
-H 'Pragma: no-cache' | |
-H 'Origin: http://localhost:8080' | |
-H 'Accept-Encoding: gzip, deflate, br' | |
-H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' | |
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36' | |
-H 'Content-Type: application/json' | |
-H 'Accept: application/json' | |
-H 'Cache-Control: no-cache' | |
-H 'Referer: http://localhost:8080/' |
var express = require('express'); | |
var request = require('request'); | |
var bodyParser = require('body-parser') | |
var app = express(); | |
app.use(bodyParser.raw()) | |
app.use('*', function(req, res) { | |
console.log(req.baseUrl) | |
req.headers['host'] = 'HOST_URL_TO_PROXY' |