- Hands-On Full:Stack Development with Swift
- Ankur Patel
- 234字
- 2021-08-27 19:39:50
Building servers using Vapor's engine
Before we start using Vapor, let's see how the Vapor package is built on top of its engine package. This will give us a better understanding of what, exactly, Vapor provides, and what is provided by the dependencies that it consumes, in case you need to build a lightweight server or want to embrace building your own variation of a web framework. We will do the following:
- First, build a basic web server that returns Hello World
- Then, modify our Hello World server to serve file content, making a static file server similar to Apache or Nginx
- Lastly, we will build a web socket server that will accept connections and echo back the message sent via the web socket connection
Going through the exercise of building these different kinds of servers using Vapor's engine will help us understand how Vapor works under the hood. It will also help us realize that building a large scale web application requires a lot of features, such as routing, persisting to the database, migrations, rendering HTML templates, and much more, which Vapor provides via its other Swift packages. This makes Vapor very modular, and anyone who wants to build something lightweight can pick and choose the modules they want, or they can use the Vapor Swift package to get the entire bundle pre-configured, making it easy to build large-scale web applications quickly.
- 物聯網安全(原書第2版)
- 物聯網智慧安監技術
- 異構基因共表達網絡的分析方法
- 農產品物聯網研究與應用
- 數字通信同步技術的MATLAB與FPGA實現:Altera/Verilog版(第2版)
- Kong網關:入門、實戰與進階
- 光纖通信系統與網絡(修訂版)
- 計算機網絡技術及應用
- Getting Started with Memcached
- 基于IPv6的家居物聯網開發與應用技術
- 深入理解計算機網絡
- Laravel Application Development Cookbook
- 網絡安全之道
- Enterprise ApplicationDevelopment with Ext JSand Spring
- Python API Development Fundamentals