All Projects → lizelu → Perfectdemo

lizelu / Perfectdemo

Licence: other
使用Swift的Perfect开发Web服务端

Labels

Projects that are alternatives of or similar to Perfectdemo

Syllabus
Syllabus for CompEcon Course
Stars: ✭ 37 (-15.91%)
Mutual labels:  makefile
Exopenwrt
Extended OpenWrt repository. Note: Latest dnscrypt-proxy merged to upstream (Designated Driver).
Stars: ✭ 39 (-11.36%)
Mutual labels:  makefile
Turris Os Packages
Mirror of https://gitlab.nic.cz/turris/turris-os-packages
Stars: ✭ 42 (-4.55%)
Mutual labels:  makefile
Ananas
This is an Arduino based program for step motor controller,Ananas.
Stars: ✭ 38 (-13.64%)
Mutual labels:  makefile
Zig.ko
Linux kernel module written in Zig
Stars: ✭ 39 (-11.36%)
Mutual labels:  makefile
Openre
HandsFree OpenRE Tutorial
Stars: ✭ 41 (-6.82%)
Mutual labels:  makefile
I2c Slave Lib
I2C slave library for AVR 8 bit mircocontrollers
Stars: ✭ 36 (-18.18%)
Mutual labels:  makefile
Coreos Stack Bootstrap
Stars: ✭ 43 (-2.27%)
Mutual labels:  makefile
Duplo
Matrix Memory dumping via GBA
Stars: ✭ 39 (-11.36%)
Mutual labels:  makefile
Trec Data
scripts to download and standardize trec query and document sets
Stars: ✭ 42 (-4.55%)
Mutual labels:  makefile
Swift Graphql
GraphQL implementation written in Swift
Stars: ✭ 38 (-13.64%)
Mutual labels:  makefile
The Ooc Language
📘 The definitive manual on the ooc programming language
Stars: ✭ 38 (-13.64%)
Mutual labels:  makefile
Lakka Libreelec
Lakka is a lightweight Linux distribution that transforms a small computer into a full blown game console.
Stars: ✭ 1,007 (+2188.64%)
Mutual labels:  makefile
Docker Unix 1st Ed
A Docker image that drops you into 1st Edition Unix
Stars: ✭ 37 (-15.91%)
Mutual labels:  makefile
Tmwa Client Data
DEPRECATED: The data used by the ManaPlus client for the tmwAthena server used by The Mana World Legacy. All further development will take place in the "client-data" repo.
Stars: ✭ 42 (-4.55%)
Mutual labels:  makefile
Llvm Cookbook
llvm-cookbook samples
Stars: ✭ 37 (-15.91%)
Mutual labels:  makefile
Cloverleaf
A hydrodynamics mini-app to solve the compressible Euler equations in 2D, using an explicit, second-order method.
Stars: ✭ 39 (-11.36%)
Mutual labels:  makefile
Sfnd lidar obstacle detection
SFND_Lidar_Obstacle_Detection
Stars: ✭ 44 (+0%)
Mutual labels:  makefile
Jekyll Bootstrap4
Bootstrap 4 with Jekyll minimalistic example site
Stars: ✭ 43 (-2.27%)
Mutual labels:  makefile
Twemoji Color Font
Twitter Unicode 13 emoji color OpenType-SVG font for Linux/MacOS/Windows
Stars: ✭ 1,006 (+2186.36%)
Mutual labels:  makefile

#Demo运行结果

PerfectTemplate 简体中文

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 3.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

Perfect Empty Starter Project

This repository holds a blank Perfect project which can be cloned to serve as a starter for new work. It builds with Swift Package Manager and produces a stand-alone HTTP executable.

Compatibility with Swift

The master branch of this project currently compiles with Xcode 8.1 or the Swift 3.0.1 toolchain on Ubuntu.

Building & Running

The following will clone and build an empty starter project and launch the server on port 8181.

git clone https://github.com/PerfectlySoft/PerfectTemplate.git
cd PerfectTemplate
swift build
.build/debug/PerfectTemplate

You should see the following output:

Starting HTTP server on 0.0.0.0:8181 with document root ./webroot

This means the server is running and waiting for connections. Access http://localhost:8181/ to see the greeting. Hit control-c to terminate the server.

Starter Content

The template file contains a very simple "hello, world!" example.

import PerfectLib
import PerfectHTTP
import PerfectHTTPServer

// Create HTTP server.
let server = HTTPServer()

// Register your own routes and handlers
var routes = Routes()
routes.add(method: .get, uri: "/", handler: {
		request, response in
		response.appendBody(string: "<html><title>Hello, world!</title><body>Hello, world!</body></html>")
		response.completed()
	}
)

// Add the routes to the server.
server.addRoutes(routes)

// Set a listen port of 8181
server.serverPort = 8181

// Set a document root.
// This is optional. If you do not want to serve static content then do not set this.
// Setting the document root will automatically add a static file handler for the route /**
server.documentRoot = "./webroot"

// Gather command line options and further configure the server.
// Run the server with --help to see the list of supported arguments.
// Command line arguments will supplant any of the values set above.
configureServer(server)

do {
	// Launch the HTTP server.
	try server.start()
} catch PerfectError.networkError(let err, let msg) {
	print("Network error thrown: \(err) \(msg)")
}

Issues

We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.

If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.

A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues

Further Information

For more information on the Perfect project, please visit perfect.org.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].