GithubHelp home page GithubHelp logo

simple-music-server's Introduction

simple-music-server

Preview

imgtu.com CDN

<img src="https://z3.ax1x.com/2021/04/09/cN3qKJ.gif">
<img src="https://z3.ax1x.com/2021/04/09/cN3Wbn.gif">

Github[./preview]

Usage

  1. make sure you have node env

  2. clone / download project

  3. install node_modules

    # yarn
    yarn
    
    # npm
    npm install
  4. open your terminal

    node ./bin/www
  5. open http://localhost:39999 in your browser(chrome/firefox/edg/ie10+)

For dev

server(express)

# router
./routes

# database
./db

# web page
./public/uploader/dist/index.html

API simple example

get token

  • request

    GET /token
    
  • response

    {
    	"status": "ok",
    	"result": "195109000f1b21f176fe6dd4f8e65df9bc70d5d07f2f3d387ec8c6faec2f9dbe",
    	"error": {}
    }

get music

  • request

    # rule /music/name?token=foo
    GET /music/aa?token=xxx
  • response

    {
    	"status": "ok",
    	"result": [
            {
                "id": 0,
                "name": "song aa 1",
                "xxx": "xxx"
            },
            {
                "id": 1,
                "name": "song aabb 2",
                "xxx": "xxx"
            }
        ],
    	"error": {}
    }

create music

  • request

    # rule /music?token=foo
    POST /music?token=xxx
    
    name=aaa&singer=bbb
  • response

    {
    	"status": "ok",
    	"result": "success",
    	"error": {}
    }

update music

  • request

    # rule /music/id?token=foo
    PUT /music/0?token=xxx
    
    name=aaa&singer=bbb
  • response

    {
    	"status": "ok",
    	"result": "success",
    	"error": {}
    }

delete music

  • request

    # rule /music/id?token=foo
    DELETE /music/1?token=xxx
  • response

    {
    	"status": "ok",
    	"result": "success",
    	"error": {}
    }

web page

webpack, mvc

# webpack config 
./public/uploader/.babelrc
./public/uploader/webpack.common.js
./public/uploader/webpack.dev.js
./public/uploader/webpack.prod.js

# entry
./public/uploader/src/index.js

# components
./public/uploader/src/components/xxx-xxx/xxx-xxx.js
./public/uploader/src/components/xxx-xxx/xxx-xxx.less

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.