datagrand-server

1.0.51 • Public • Published

proxy dev server for datagrand

安装

npm i datagrand-server -g

参数

  • static: [array],项目本地静态资源目录或文件,必须
  • api: [string],服务器域名或 ip,请写明 http 或 https,必须
  • cookie: [array],需要在 http header 中加入的 cookie,格式为{"name": "cookieName", "value": "cookieValue"},可选
  • root: [string],项目中请求的根目录,比如请求地址如果是/rootDir/***/*.*,则此选项应为rootDir/,可选
  • config: [string],前端项目配置接口路径,在代理中此地址会被替换为本地路径,可选
  • open: [string],代理服务器启动时打开的页面地址,可选
  • login: [string], cookie 失效时打开的登陆地址,可选

使用

在项目下配置 proxy.json

{
  "static": ["css/", "js/", "img/", "index.html", "signin.html"],
  "cookie": [{
    "name": "PHPSESSID",
    "value": "a6e1nkaqmh3ioju6u838qod4s5"
  }, {
    "name": "admin_login_status",
    "value": 1
  }],
  "api": "http://admin.datagrand.net",
  "root": "admin/",
  "config": "controlpanel/config/panel",
  "open": "http://localhost:3000/admin/index.html",
  "login": "http://admin.datagrand.net/admin/signin.html#/login"
}

在项目根目录执行

dgProxy

插件使用3000端口,请确保3000端口没有被占用!

todo

  • 监视本地文件并刷新

Readme

Keywords

none

Package Sidebar

Install

npm i datagrand-server

Weekly Downloads

1

Version

1.0.51

License

ISC

Last publish

Collaborators

  • younixiao