This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readline = require('readline'); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}); | |
let values = []; | |
// Чтение ввода | |
console.log('Правила ввода: введите значения, разделяя их новой строкой. Когда ввод закончен, нажмите Ctrl + C'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sass = require('@zeit/next-sass'); | |
const getRoutes = require('./routes'); | |
module.exports = sass(); | |
module.exports = { | |
exportPathMap: getRoutes | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const exp = require('express'); | |
const app = exp(); | |
app.listen(4000, () => console.log('Listening on 4000')); | |
app.use(exp.static('./')); | |
app.use((req, res, next) => { | |
res.header('Access-Control-Allow-Origin', '*') | |
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')() | |
const http = require('http').Server(app) | |
const io = require('socket.io')(http) | |
app.get('/', | |
(req, res) => res.sendFile( | |
__dirname + '/index.html' | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
app.get('/', function(req, res){ | |
res.sendFile(__dirname + '/index.html'); | |
}); | |
http.listen(3000, function(){ | |
console.log('listening on *:3000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
app.get('/', function(req, res){ | |
res.sendFile('index.html'); | |
}); | |
io.on('connection', function(socket){ | |
socket.on('message', function(msg){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')() | |
app.use((req, res, next) => { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
res.header("Content-Type", "application/json") | |
next(); | |
}); | |
app.get('/', (req, res) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')() | |
app.use(require('cors')()) | |
app.get('/verycoolguy/posts/1', (req,res) => { | |
res.sendFile(__dirname + '/post.json') | |
}) | |
app.listen(4000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const app = require('express')() | |
app.use(require('cors')()) | |
app.get('/verycoolguy/posts/1', | |
(req, res) => res.sendFile(__dirname + '/post.json') | |
) | |
app.get('/cdn/verycoolguy/posts/1/img.jpg', | |
(req, res) => res.sendFile(__dirname + '/img.jpg')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import axios from 'axios' | |
import ReactMarkdown from 'react-markdown' | |
import Img from 'react-image' | |
export default class Post extends Component { | |
constructor () { | |
super() | |
this.state = { | |
content: '', |
OlderNewer