Giter Club home page Giter Club logo

ssr's Introduction

ssr

将一个目录设置成一个静态服务器。。大家肯定遇到过,当后端 API 没有编写完成时,前端无法进行调试,这就导致了前端会被后端阻塞的情况。而ssr相当于是搭建了一个 Mock Server ,构建假数据,然后把这些假数据存到 JSON 文件上,Mock Server 可以响应请求或者生成页面,当然也可以顺便生成 API 文档。

全局安装

npm install -g ssr 

命令帮助。

Usage: ssr [options]

Options:
  --help, -h         Show help                                        
  --version, -V, -v  Show version number                              
  --port, -p         Set the port!
  --cors, -c         allows cross origin access serving

  copyright 2015

命令使用 ssr

$ ssr           # 默认 端口 1987   访问地址:=> http://localhost:1987
$ ssr -p 2015   # 端口设置 2015   访问地址:=> http://localhost:2015
$ ssr -cp 2015   #端口设置 2015  并且 可以跨域访问

注意: 默认不传端口,起多个服务不会发生端口冲突,尽情玩耍吧。

当前目录安装

npm install ssr

nodejs 中应用

var ssr = require('ssr');
    ssr(1998);

ssr's People

Contributors

jaywcjlove avatar

Watchers

James Cloos avatar mark.k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.