Swiftpack.co - Samasaur1/SimpleSwiftServer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Samasaur1.
Samasaur1/SimpleSwiftServer v4.3.1
A Swift executable equivalent to Python's SimpleHTTPServer — plus more!
⭐️ 3
🕓 2 years ago
linux macOS iOS
.package(url: "https://github.com/Samasaur1/SimpleSwiftServer.git", from: "v4.3.1")

Server

A Swift executable equivalent to Python's SimpleHTTPServer — with extra features!

Installing

Make sure Xcode 10.2 or higher is installed first.

Homebrew

$ brew install Samasaur1/core/simpleswiftserver

Mint

Install

$ mint install Samasaur1/SimpleSwiftServer
Update
$ mint install Samasaur1/SimpleSwiftServer

Swift Package Manager

Use CLI

$ git clone https://github.com/Samasaur1/SimpleSwiftServer.git
$ cd SimpleSwiftServer
$ swift run server

Usage

SimpleSwiftServer has two modes: a file downloader (to easily share files) and a directory browser. It also allows you to specify your port.

The default port is 1234, the default mode is a directory browser, and the default path is the current directory.


Opens a directory browser from the current directory on port 1234

$ server

Opens a directory browser from the current directory on port 4321

$ server 4321

Opens a directory browser from the Desktop subdirectory on port 1234

$ server --browse Desktop

Opens a file downloader for the file Package.swift in the Desktop subdirectory on port 1234

$ server --file Desktop/Package.swift

Opens a directory browser from the root directory on port 46264. Note: this is a terrible idea, as any confidential files (tokens, keys) are publically accessible. Share the smallest amount of your system that you need.

$ server 46264 --browse /

GitHub

link
Stars: 3
Last commit: 18 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Version 4.3.1: URL-decode file paths before attempting to open them
2 years ago

This allows webserver mode to correctly open files with space characters in them, along with other characters.

What's Changed

Full Changelog: https://github.com/Samasaur1/SimpleSwiftServer/compare/v4.3.0...v4.3.1

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics