Code Monkey home page Code Monkey logo

12306-api's Introduction

12306-api

基于express的12306车次时刻表API,输入车次及乘车日期即可返回对应时刻表。

原理

go-homeParse12306的启发,通过访问12306时刻表查询API得到结果,并对数据做进一步装饰。

使用

环境

node.js + mysql5.7

数据库

进入mysql命令行,执行init_db.sql

配置

修改dao/database.js中数据库设置

var pool = mysql.createPool({
    connectionLimit: 10,
    host: '127.0.0.1',  //数据库地址
    user: 'root', //用户名
    password: 'password', //密码
    database: '12306api',
    port: 3306  //端口
});

导入数据

分别下载车次数据车站数据,按照表结构导入数据库。 自动导入数据的功能将在未来加入。

运行

npm start

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.