sohu-test-server

0.1.4 • Public • Published

简介

一个简单的代理服务,使用nodejs编写,用于替代开发环境中使用的nginx.

使用理由:

  1. 专为团队定制,无需配置,指定自已工作目录即可。
  2. 请求、响应通过Http头禁用了缓存,保证调试代码都是新鲜的。
  3. 可探测源文件编码通过Http头指明字节流的编码,不会出现Html指明需要GBK,而JS源码保存为UTF-8而出现乱码问题。
  4. 因JS编写一切自已所需定制功能都可以自已动手。

如何走起?

方法1:

npm install -g sohu-test-server
cd ~
mkdir -p sites/sohu
ln -s ${PRO1}/js    site/sohu/js
ln -s ${PRO1}/css   site/sohu/css
ln -s ${PRO1}/img   site/sohu/img
ln -s ${PRO1}/swf   site/sohu/swf
ln -s ${PRO2}       site/sohu/upload
sohutestd 

方法2:

1. node >= v0.8	(我的环境是0.8+ 低版没测过~~)
2. clone源码
3. 根据自已环境修改conf/default.js文件 (default.js)是根据我自已环境配滴
4. 进入目录内`node app.js`即可

自定义配置可用环境量:

{
  protocol: 'http:',
  slashes: true,
  host: 'tv.sohu.com',
  hostname: 'tv.sohu.com',
  href: 'http://tv.sohu.com/upload/swf/20130510/skins/s1.swf',
  pathname: '/upload/swf/20130510/skins/s1.swf',
  path: '/upload/swf/20130510/skins/s1.swf',
  rawurl: 'http://tv.sohu.com/upload/swf/20130510/skins/s1.swf' 
}

可用操作:

head(key, value)
exists(file)
detect(file)
rewrite(file, ctype)

Readme

Keywords

none

Package Sidebar

Install

npm i sohu-test-server

Weekly Downloads

5

Version

0.1.4

License

none

Last publish

Collaborators

  • iisii