Giter Site home page Giter Site logo

srkit's Introduction

SRKit

My Kit

###{转} 自己搭建服务器,获取数据测试 ###

1.安装Homebrew 2.安装Nginx 3.启动Nginx 4.配置JSON文件 5.配置Niginx

##1.在终端输入安装brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ##2.在终端输入安装Nginx: brew install nginx ##3.在终端输入启动安装好的Nginx:nginx ##4.前往文件夹:/usr/local/Cellar/nginx/  ->版本号 ->html ->创建一个aaa.json,在里面键入你要的数据 ##5.前往文件夹:/usr/local/etc/ ->nginx  找到nginx.conf.default用文本编辑打开 copy数据: server {
listen 8080;
server_name localhost;
#access_log logs/host.access.log main; location ~* {
add_header Content-Type "application/json"; root html;
if (!-f $request_filename) {
rewrite ^/(.*) /$1.json last; }
index index.php index.html index.htm; }
error_page 405 =200 http://$host$request_uri; }

##6.在浏览器输入:localhost:8080/aaa.json 即可访问你的数据 ##7.用Get 请求http://localhost:8080/aaa.json ##8.大功告成

srkit's People

Contributors

suruihtg avatar

Watchers

James Cloos avatar  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.