Coder Social home page Coder Social logo

mars-server's Introduction

mars-server

mars frontend news server

快速入门

$ npm install

本地开发

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

测试

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

TODO

  • 微信推送抓取文章
  • 文章规则添加
  • 定时群发
  • 授权登录:微信、github
  • 管理系统:推送统计,阅读统计、文章再次编辑

API

文章列表

GET url: /api/post
query: {
    page?: 1,
    limit?: 15
}
response: {
    error: {
        returnCode: 0,
        returnMessage: 'success',
        returnUserMessage: '成功'
    },
    data: {
        posts: [{
            id: 62,
            title: '[译] 写给前端开发者的 GraphQL 指南',
            description: '',
            thumb: '',
            url: 'https://zhuanlan.zhihu.com/p/36253316',
            user: {
                avatar: '',
                name: ''
            }
        }],
        pages: {
            page: 1, // 当前页
            total: 63, // 总数量
            limit: 15, // 每页多少条
            totalPage: 5 // 总页数
        }
    }
}

文章内容

GET url: /api/post/:id
response: {
    error: {
        returnCode: 0,
        returnMessage: 'success',
        returnUserMessage: '成功'
    },
    data: {
        id: 62,
        title: '[译] 写给前端开发者的 GraphQL 指南',
        description: '',
        thumb: '',
        url: 'https://zhuanlan.zhihu.com/p/36253316',
        html: '',
        markdown: '',
        user: {
            avatar: '',
            name: ''
        }
    }
}

增加文章浏览量

GET url: /api/post/view
query: {
    id: 12 // 文章id
}
response: {
    error: {
        returnCode: 0,
        returnMessage: 'success',
        returnUserMessage: '成功'
    },
    data: {
        views: 12
    }
}

mars-server's People

Contributors

huanz avatar

Watchers

 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.