1.1.8 • Published 7 years ago

dfy v1.1.8

Weekly downloads
6
License
ISC
Repository
github
Last release
7 years ago

dfy

大房鸭前端工具,为解决开发中出现问题而诞生。

安装插件

全局安装

npm install -g dfy

或者本地安装到项目所在目录。

npm install dfy

##例子

执行dfy -h命令,查看帮助文档,有initserver命令

Usage: dfy [options]

Commands:

init [options]              scaffold with specifed template.
server [options] [options]  launch a server

Options:

-h, --help     output usage information
-V, --version  output the version number

###创建项目init options

创建一个h5项目目录,只需执行dfy init h5

###启动跨域服务器server options

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

在本地环境下ajax请求测试服务器数据,后端拒绝的情况下,只需执行dfy server start默认端口8010,本地请求地址改成http://127.0.0.1:8010/

需要改动端口需要执行dfy server start -p 8020

查看help命令,执行dfy server -h

  Usage: server [options] [options]

  launch a server

  Options:

    -h, --help                  output usage information
    -p, --port <int>            server listen port
    -d, --domain <domain name>  domain name
  • -p, --port :指定端口,(默认端口8010)
  • -d, --domain :指定域名,(默认域名www.dafangya.com.cn/h5/)

AJAX请求,支持GET、POST请求方式

dfy server start -d www.baidu.com

20160507105740

	$.ajax({
		url: 'http://127.0.0.1:8010/', //指定百度网址
		type: 'GET',
		data: {
			// name:'wiwi'
		},
		success: function (data) {//请求数据接口进入success回调函数
			console.log(data)
		},
		error: function(data){//请求网页html内容进入error回调函数
			console.log(data.responseText)
		}
	})
1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago