Skip to content

Instantly share code, notes, and snippets.

@Anebrithien
Created February 5, 2015 10:25
Show Gist options
  • Save Anebrithien/dd11d64e19172f0d7666 to your computer and use it in GitHub Desktop.
Save Anebrithien/dd11d64e19172f0d7666 to your computer and use it in GitHub Desktop.

LiteFileServer

使用Google Dart构建的轻量级、简单的文件下载服务器。 不需要安装nginx/apache,占用更少的资源。

1.安装dart sdk

请参考:这里

2.添加pub到环境变量

export PATH=$PATH:/usr/lib/dart/bin

3.获取项目

git clone https://github.com/Jokder/LiteFileServer.git

4.配置

配置文件是LiteFileServer/conf.json

{
"version": "0.0.1",
"port":8082,      #端口号
"root":"web"      #站点根目录
}

文件列表从站点根目录下的files目录中读取。

5.运行

cd LiteFileServer
pub install
nohup dart main.dart >/dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment