Awesome Open Source
Awesome Open Source

SwiftEngine

We work for πŸŒŸβ€™s and πŸ΄β€™s ... please Star our repo

πŸ™‹ Hey there!
Please note: This project is still in Alpha Version and we’re actively working on forking over a lot of nifty features from SwiftEngine to make it compatible with SwiftNIO. We appreciate any contributors or testers joining our project!

Features 😍

  • Swift on Back-End - Improve productivity by using the modern Swift language for all your app's development needs (learn more)
  • Hot Code Reload - Increase the speed of your endpoints as each file is individually compiled. If a file has not been modified since it was last used, it won't need to be recompiled (learn more)
  • Automated Routing Logic - Avoid writing custom routers; SwiftEngine will automagically route each request to the desired file (learn more)
  • Uptime Resiliency - Reduce risk by leveraging a fail-safe and high-availability operating environment where each client requests functions independently (learn more)
  • Easy web based run-time error analysis - Save time by not having to dig through shell dumps; SwiftEngine displays the full error trace on your browser for easy debugging (learn more)

Getting Started πŸ’₯

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites ❗️

What are the dependencies we need to get this to work?

OS Version
macOS 10.13+
Ubuntu 14.04, 16.04, 16.10

Getting started with the project πŸ‘

  1. Clone this repo: git clone https://github.com/swiftengine/SwiftEngine.git
  2. cd to SwiftEngine directory and run sudo ./install.sh
  3. Run ./run.sh This should start the server running and listening on port 8887

Using ⭐️

Programming your site:

  1. Create a new mypage.swift file within the /var/swiftengine/www/ directory (see example below)
  2. From the browser, enter the following url http://<machine_ip>:8887/mypage (by default this is localhost:8887)

That's it! No compilation or dealing with shell dumps required! Your requested endpoints will be automagically compiled during the first request, and results will be shown.

Any swift file you place in /var/swiftengine/www will be accessible through the browser without the .swift extension. Read more about SwiftEngine's autonomous system and routing logic (here)

Example of a SwiftEngine based .swift file πŸ†

// Import SwiftEngine essentials
import SwiftEngine


// specify other required files for this file
//se: require /common.swift

// Entry Point function; where all code begins
func entryPoint(ctx: RequestContext) {

	// add GET handlers to the request context
	ctx.addHandler(forMethod:"GET", withRoute:"*"){
		req, res in
		res.write("Hello from SwiftEngine!")
	}

	// add POST handlers to the request context
	ctx.addHandler(forMethod:"POST", withRoute:"*"){
		req, res in
		res.write("Handle for POST request method")
	}

	// add catch-all handlers to the request context
	ctx.addHandler(forMethod:"*", withRoute:"*"){
		req, res in
		res.write("Handle for catch-all")
	}

}

Built With β˜€οΈ

Contributing πŸ‘ͺ

We would love to hear your thoughts and feedback about SwiftEngine. If you would like to contribute to our project or have an issue you would like to open, please visit our CONTRIBUTING document for more details.

Authors 🏭

Contact Us 🏭

License 🎢

This project is licensed under the Mozilla Public License Version 2.0 - see the LICENSE file for details


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Swift (94,806)Β 
Serverless (4,702)Β 
Http Server (1,437)Β 
Server Side Swift (380)Β 
Related Projects
Advertising πŸ“¦Β 9
All Projects
Application Programming Interfaces πŸ“¦Β 120
Applications πŸ“¦Β 181
Artificial Intelligence πŸ“¦Β 72
Blockchain πŸ“¦Β 70
Build Tools πŸ“¦Β 111
Cloud Computing πŸ“¦Β 79
Code Quality πŸ“¦Β 28
Collaboration πŸ“¦Β 30
Command Line Interface πŸ“¦Β 48
Community πŸ“¦Β 81
Companies πŸ“¦Β 60
Compilers πŸ“¦Β 60
Computer Science πŸ“¦Β 74
Configuration Management πŸ“¦Β 39
Content Management πŸ“¦Β 167
Control Flow πŸ“¦Β 197
Data Formats πŸ“¦Β 77
Data Processing πŸ“¦Β 266
Data Storage πŸ“¦Β 132
Economics πŸ“¦Β 60
Frameworks πŸ“¦Β 198
Games πŸ“¦Β 122
Graphics πŸ“¦Β 103
Hardware πŸ“¦Β 148
Integrated Development Environments πŸ“¦Β 47
Learning Resources πŸ“¦Β 147
Legal πŸ“¦Β 28
Libraries πŸ“¦Β 119
Lists Of Projects πŸ“¦Β 21
Machine Learning πŸ“¦Β 336
Mapping πŸ“¦Β 61
Marketing πŸ“¦Β 15
Mathematics πŸ“¦Β 55
Media πŸ“¦Β 228
Messaging πŸ“¦Β 97
Networking πŸ“¦Β 304
Operating Systems πŸ“¦Β 84
Operations πŸ“¦Β 120
Package Managers πŸ“¦Β 52
Programming Languages πŸ“¦Β 229
Runtime Environments πŸ“¦Β 96
Science πŸ“¦Β 42
Security πŸ“¦Β 375
Social Media πŸ“¦Β 26
Software Architecture πŸ“¦Β 70
Software Development πŸ“¦Β 68
Software Performance πŸ“¦Β 57
Software Quality πŸ“¦Β 127
Text Editors πŸ“¦Β 45
Text Processing πŸ“¦Β 131
User Interface πŸ“¦Β 310
User Interface Components πŸ“¦Β 465
Version Control πŸ“¦Β 29
Virtualization πŸ“¦Β 68
Web Browsers πŸ“¦Β 38
Web Servers πŸ“¦Β 25
Web User Interface πŸ“¦Β 194