Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
041275e8
Commit
041275e8
authored
Jul 23, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a basic HTTP server for Sky
parent
646ff43f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
sky_server.dart
packages/flutter_tools/bin/sky_server.dart
+48
-0
pubspec.yaml
packages/flutter_tools/pubspec.yaml
+2
-1
No files found.
packages/flutter_tools/bin/sky_server.dart
0 → 100644
View file @
041275e8
// Copyright 2015 The Chromium Authors. 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:async'
;
import
'dart:io'
;
import
'package:http_server/http_server.dart'
;
const
String
usage
=
'Usage: sky_server PORT'
;
main
(
List
<
String
>
argv
)
async
{
if
(
argv
.
length
!=
1
)
{
print
(
usage
);
return
;
}
int
port
;
try
{
port
=
int
.
parse
(
argv
[
0
]);
}
catch
(
e
)
{
print
(
usage
);
return
;
}
VirtualDirectory
currentDirectory
=
new
VirtualDirectory
(
'.'
)
..
allowDirectoryListing
=
true
;
HttpServer
server
;
try
{
server
=
await
HttpServer
.
bind
(
InternetAddress
.
LOOPBACK_IP_V4
,
port
);
}
catch
(
e
)
{
print
(
e
);
return
;
}
server
.
defaultResponseHeaders
..
removeAll
(
'x-content-type-options'
)
..
removeAll
(
'x-frame-options'
)
..
removeAll
(
'x-xss-protection'
)
..
add
(
'cache-control'
,
'no-cache'
);
server
..
autoCompress
=
true
..
listen
(
currentDirectory
.
serveRequest
);
print
(
'Sky server running on port
$port
'
);
}
packages/flutter_tools/pubspec.yaml
View file @
041275e8
author
:
Chromium Authors <sky-dev@googlegroups.com>
author
:
Chromium Authors <sky-dev@googlegroups.com>
dependencies
:
dependencies
:
args
:
'
>=0.13.0
<1.0.0'
args
:
^0.13.0
http_server
:
^0.9.5
description
:
Tools for building Sky applications
description
:
Tools for building Sky applications
homepage
:
https://github.com/domokit/sky_tools
homepage
:
https://github.com/domokit/sky_tools
name
:
sky_tools
name
:
sky_tools
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment