Perfect Cookie Demo 简体中文
A Cookie read/set example using Perfect
This example demonstrates the use or cookie read & set using Perfect's HTTP request and response objects.
This package builds with Swift Package Manager and is part of the Perfect project.
Ensure you have installed Xcode 8.0 or later.
NOTE: Steps below regarding the Library Search paths can be avoided by installing swiftenv and installing the Swift 3.0.1 preview toolchain.
# after installing swiftenv from https://swiftenv.fuller.li/en/latest/
swiftenv install https://swift.org/builds/swift-3.0.1-preview-1/xcode/swift-3.0.1-PREVIEW-1/swift-3.0.1-PREVIEW-1-osx.pkg
- Check out or download the project;
- In terminal, navigate to the directory and execute
swift package generate-xcodeproj
- Open
Perfect-Cookie-Demo.xcodeproj
- Add to the "Library Search Paths" in "Project Settings"
$(PROJECT_DIR)
, recursive. (This step will be unneeded in a future release of Xcode 8.) - Select the Executable build target from the build targets dropdown in Xcode
- Run (cmd-R) to build & run in Xcode.
In Xcode's console output pane you will see:
[INFO] Starting HTTP server on 0.0.0.0:8181 with document root ./webroot
- In a browser, visit http://localhost:8181/
- Check out or download the project;
- In terminal, navigate to the directory
- Execute
swift build
- Once the project has compiled, execute
./.build/debug/Perfect-Cookie-Demo
The output you will see:
[INFO] Starting HTTP server on 0.0.0.0:8181 with document root ./webroot
- In a browser, visit http://localhost:8181/
The following routes are included in this API for demonstration purposes:
- GET: http://localhost:8181/ - Lists the cookies currently set in the browser for the domain.
- GET: http://localhost:8181/set - Sets a cookie with an expiration of 60 seconds.
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
For more information on the Perfect project, please visit perfect.org.