This file contains hidden or 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 koa = require("koa"); | |
const views = require("koa-views"); | |
const path = require("path"); | |
const bodyParser = require("koa-bodyparser"); | |
const static = require("koa-static"); | |
const Router = require("koa-router"); | |
const app = new koa(); | |
const router = new Router(); | |
// 加载模版引擎 | |
app.use(views(__dirname + "/views"), { |
This file contains hidden or 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 Koa = require('koa'); | |
const app = new Koa() | |
const Router = require("./router"); | |
const router = new Router(); | |
router.get('/',(context,next)=>{ | |
context.body = 'index Page' | |
}) |
This file contains hidden or 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 Koa = require("koa"); | |
const Route = require("koa-router"); | |
const app = new Koa(); | |
const router = Route(); | |
router | |
.get("/", async (ctx, next) => { | |
ctx.body = "Hello World"; | |
console.log("get"); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Test Suite</title> | |
<style> | |
#results li.pass { |
This file contains hidden or 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 'package:flutter/material.dart'; | |
import 'package:english_words/english_words.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
final wordPair = new WordPair.random(); | |
// return new MaterialApp( |
This file contains hidden or 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 'package:flutter/material.dart'; | |
import 'package:english_words/english_words.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Startup name', |
This file contains hidden or 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 http = require('http') | |
const app = http.createServer((req, res) => { | |
res.writeHead(200, { 'Content-Type': "text/plain" }); | |
res.end('Hello World\n'); | |
}) | |
app.listen(4000, '0.0.0.0'); |
This file contains hidden or 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 https = require('https'); | |
const fs = require('fs') | |
const options = { | |
key: fs.readFileSync('./cert/domain.key'), | |
cert: fs.readFileSync('./cert/domain.pem') | |
} | |
const app = https.createServer(options, (req, res) => { | |
res.writeHead(200, { 'Content-Type': 'text/plain' }) | |
res.end('Hello World!\n') |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>WebRTC-音视频采集</title> | |
<style> | |
.none { |
This file contains hidden or 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 http2 = require('http2'); | |
const fs = require('fs'); | |
const server = http2.createSecureServer({ | |
key: fs.readFileSync('./cert/domain.key'), | |
cert: fs.readFileSync('./cert/domain.pem') | |
}); | |
server.on('error', (err) => console.log(err)); |