Web server serving local files

Overview

swift-web

A web server serving local static files.

Installation

Using Mint

The easiest way to install swift-web is via mint.

mint install adam-fowler/swift-web

Using Swift Package Manager

git clone https://github.com/adam-fowler/swift-web
swift build -c release

And then copy .build/release/swift-web to a folder in your $PATH

Running

To serve files from the current folder run

swift web

This will run a web server bound to port 8001. Type localhost:8001/<filename> into your web browser to view a file.

To serve files from a particular folder run

swift web <folder>

You can also change the port the server uses with the --port option.

swift web <folder> --port 8080
You might also like...
Sharing SQL queries between Server and Mobile databases

Sharing SQL queries between Server and Mobile databases Overview As we all know, code is expensive to maintain, and the more complex the code, the mor

This Project domonstrate the latest Swift on Server to create RESTFul API's connected via Database: MongoDB NoSql

Swift is a general-purpose programming language built using a modern approach to safety & performance that make it specifically suitable for Server applications. Vapor is a web framework for Swift, allowing you to write backends, web apps APIs and HTTP servers in Swift

Server-driven SwiftUI - Maintain iOS apps without making app releases.

ServerDrivenSwiftUI Maintain ios apps without making app releases. Deploy changes to the server and users will receive changes within minutes. This pa

AudioPlayer is syntax and feature sugar over AVPlayer. It plays your audio files (local & remote).

AudioPlayer AudioPlayer is a wrapper around AVPlayer. It also offers cool features such as: Quality control based on number of interruption (buffering

StorageManager - FileManager framework that handels Store, fetch, delete and update files in local storage
StorageManager - FileManager framework that handels Store, fetch, delete and update files in local storage

StorageManager - FileManager framework that handels Store, fetch, delete and update files in local storage. Requirements iOS 8.0+ / macOS 10.10+ / tvOS

FileManager replacement for Local, iCloud and Remote (WebDAV/FTP/Dropbox/OneDrive) files -- Swift
FileManager replacement for Local, iCloud and Remote (WebDAV/FTP/Dropbox/OneDrive) files -- Swift

This Swift library provide a swifty way to deal with local and remote files and directories in a unified way. This library provides implementaion of W

Player for streaming local and remote audio files. Written in Swift.
Player for streaming local and remote audio files. Written in Swift.

Jukebox is an iOS audio player written in Swift. Contents Features Installation Supported OS & SDK versions Usage Handling remote events Public interf

WebViewKit adds a WebView to SwiftUI, that can be used to present local and online web pages
WebViewKit adds a WebView to SwiftUI, that can be used to present local and online web pages

WebViewKit adds a WebView to SwiftUI, that can be used to present local and online web pages

MMBarricade - Runtime configurable local server for iOS apps.
MMBarricade - Runtime configurable local server for iOS apps.

MMBarricade Why Barricade? MMBarricade is a framework for setting up a run-time configurable local server in iOS apps. This works by creating a NSURLP

Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.

Installation • Configuration • Usage • Build Script • Donation • Migration Guides • Issues • Contributing • License BartyCrouch BartyCrouch incrementa

A Swift sample code to reads ISO 10303-21 exchange structures (STEP P21 files for AP242) split into multiple files using external references approach.

multipleP21ReadsSample A Swift sample code to reads ISO 10303-21 exchange structures (STEP P21 files for AP242) split into multiple files using extern

BeatboxiOS - A sample implementation for merging multiple video files and/or image files using AVFoundation

MergeVideos This is a sample implementation for merging multiple video files and

NotionDrive - A swift package that can upload files to Notion.so or download files from Notion.so

NotionDrive NotionDrive is a swift package that can upload files to Notion.so or

A tiny Safari Web Extension for presenting highlighted JSON files
A tiny Safari Web Extension for presenting highlighted JSON files

A tiny Safari Web Extension for presenting highlighted JSON files

Steps and files needed to reproduce a CSP bug in Safari Web Extensions

CSP Safari bug repro There appears to be a discrepancy between how Safari handles CSP policies for extension pages compared to how other browsers do s

A Swift web framework and HTTP server.
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

💧 A server-side Swift web framework.
💧 A server-side Swift web framework.

Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project. Take

Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.

Why Zewo? • Support • Community • Contributing Zewo Zewo is a lightweight library for web applications in Swift. What sets Zewo apart? Zewo is not a w

💧 A server-side Swift web framework.
💧 A server-side Swift web framework.

Vapor is a web framework for Swift. It provides a beautifully expressive and easy to use foundation for your next website, API, or cloud project. Take

Comments
  • Resolve index.html

    Resolve index.html

    Most web servers try to deliver index.html if a request is made to a path that doesn't end in a file name.

    It seems this is currently not supported by swift-web.

    Consider the following folder layout:

    ├── index.html
    ├── posts
    │   ├── async-await-in-swiftui
    │   │   ├── header2.png
    │   │   ├── index.html
    

    Requesting the root folder (only headers, notice the content length)

    $ curl -I localhost:8000
    HTTP/1.1 200 OK
    content-length: 416
    modified-date: Fri, 3 Dec 2021 13:27:05 GMT
    eTag: W/"04031e0c0405383032352e3430373532"
    Date: Fri, 3 Dec 2021 13:31:25 GMT
    connection: keep-alive
    server: swift-web
    

    Requesting /index.html (only headers, notice the content length):

    $ curl -I localhost:8000/index.html
    HTTP/1.1 200 OK
    content-length: 12822
    modified-date: Mon, 29 Nov 2021 09:35:44 GMT
    eTag: W/"060f1e09030f0a0734342e3837313636"
    content-type: text/html
    Date: Fri, 3 Dec 2021 13:31:33 GMT
    connection: keep-alive
    server: swift-web
    
    opened by peterfriese 1
Releases(0.0.2)
Owner
Adam Fowler
Used to make video games, can't be arsed anymore
Adam Fowler
pick the voice from the local storage.you can play and pause the voice

flutter_add_voice A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you starte

Mehrab Bozorgi 1 Nov 27, 2021
rTracker is a complete iOS application for creating local on-device databases ('trackers') to log data with timestamps.

rTracker is a complete iOS application for creating local on-device databases ('trackers') to log data with timestamps. Trackers can use a va

Rob Miller 40 Dec 10, 2022
Easiest local storage library in Swift

SundeedQLite SundeedQLite is the easiest offline database integration, built using Swift language Requirements iOS 12.0+ XCode 10.3+ Swift 5+ Installa

Nour Sandid 15 Sep 23, 2022
A library that provides the ability to import/export Realm files from a variety of data container formats.

Realm Converter Realm Converter is an open source software utility framework to make it easier to get data both in and out of Realm. It has been built

Realm 212 Dec 9, 2022
macOS WeChat.app header files version history (automatic updated)

macos-wechat-app-tracker macOS WeChat.app header files version history (automatic updated) Troubleshooting $ class-dump -H /Applications/WeChat.app 20

Wechaty 3 Feb 10, 2022
Classes-and-structures-in-swift - This source files show what is the difference between class and structure

This source files show what is the difference between class and structure You ca

null 0 Jan 4, 2022
Easy and beautiful way for a user to pick content, files or images. Written in Objective C

##JVTImageFilePicker Description ImageFilesPicker Is a butifuly designed UICompenent for uploading content Preview from recent camera roll Live Camera

Matan Abravanel 60 Jun 19, 2022
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.

Perfect - FileMaker Server Connector This project provides access to FileMaker Server databases using the XML Web publishing interface. This package b

PerfectlySoft Inc. 33 Jul 13, 2022
A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift

A fast, pure swift MongoDB driver based on Swift NIO built for Server Side Swift. It features a great API and a battle-tested core. Supporting both MongoDB in server and embedded environments.

null 646 Dec 10, 2022
🔥 🔥 🔥Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

?? ?? ??Support for ORM operation,Customize the PQL syntax for quick queries,Support dynamic query,Secure thread protection mechanism,Support native operation,Support for XML configuration operations,Support compression, backup, porting MySQL, SQL Server operation,Support transaction operations.

null 60 Dec 12, 2022