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 'package:flutter/material.dart'; | |
void main() => runApp(MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
body: Padding( | |
// padding: const EdgeInsets.only(top: 20, left: 20, right: 20), | |
padding: const EdgeInsets.all(0), | |
child: Page() | |
) |
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 http = require('http'); | |
const { parse } = require('querystring'); | |
const server = http.createServer((req, res) => { | |
if (req.method === 'POST') { | |
collectRequestData(req, result => { | |
console.log(result); | |
res.end(`Parsed data belonging to ${result.fname}`); | |
}); | |
} |
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 'package:shelf_router/shelf_router.dart'; | |
import 'package:shelf/shelf.dart'; | |
import 'package:shelf/shelf_io.dart' as io; | |
void start() async { | |
// Initiate server | |
const port = 8081; | |
final app = Router(); | |
// CORS Settings |
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 'dart:io'; | |
import 'package:shelf/shelf.dart' as shelf; | |
import 'package:shelf/shelf_io.dart' as io; | |
// For Google Cloud Run, set _hostname to '0.0.0.0'. | |
const _hostname = 'localhost'; | |
const _port = 8080; | |
void main(List<String> args) async { |
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
// web/console.dart | |
@JS('console') | |
library console; | |
import 'package:js/js.dart'; | |
external void log(dynamic str); |
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 net = require('net'); | |
var sockets = []; | |
var port = 8000; | |
var guestId = 0; | |
var server = net.createServer(function(socket) { | |
// Increment | |
guestId++; | |
socket.nickname = "Guest" + guestId; |
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
// bin/main.dart | |
import 'dart:io'; | |
import 'package:mime/mime.dart'; | |
main() async { | |
var server = await HttpServer.bind('localhost', 8085); | |
server.listen((request) async { |
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 'dart:io'; | |
import 'dart:mirrors'; | |
main() async { | |
var server = await HttpServer.bind('localhost', 8085); | |
await for (HttpRequest req in server) { | |
// Create InstanceMirror type from which | |
// we retrieve metadata information | |
var ref = reflect(Endpoint(req)); |
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 express = require('express'); | |
const request = require('request'); | |
const app = express(); | |
const oauthDetails = { | |
client_id: '[your client id]', | |
client_secret: '[your client secret]', | |
redirect_uri: 'http://localhost:3000/oauth/callback' | |
}; |
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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'dart:math' as math; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
NewerOlder