return React.createElement("input", _defineProperty({
name: data.name,
type: data.type,
defaultValue: data.value,
value: this.state.value,
className: data.className + this.state.error_emty_field,
placeholder: data.placeholder,
onChange: data.onChange
}, "onChange", this.enterToThisState.bind(this)));
<base href="/">
https://developer.mozilla.org/ru/docs/Web/HTML/Ele... const fs = require('fs');
const path = require('path');
const http = require('http');
const url = require('url');
const publicFolder = 'public';
const mime = {
'css': 'text/css',
'html': 'text/html',
'js': 'text/javascript'
};
http.createServer((req, res) => {
if (req.method == 'GET') {
const {pathname} = url.parse(req.url);
const file = path.resolve(__dirname, publicFolder, pathname.slice(1) || 'index.html');
res.setHeader('Content-Type', mime[path.extname(file).slice(1)] || 'text/plain');
fs.createReadStream(file).on('error', err => handleError(err, req, res)).pipe(res);
} else {
handleError(404, req, res);
}
}).listen(3000);
function handleError(err, req, res) {
res.statusCode = 500;
if (typeof err == 'number') res.statusCode = err;
else if (typeof err == 'object' && err.code == 'ENOENT') res.statusCode = 404;
res.end();
}