@jxding/db-ts-npm-test
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Module Name

This is one basic module for integration.

Installation

$ npm install --save @jxding/db-ts-npm-test

Quick Start

import Koa from 'koa'
import {exportsFunc} from '@jxding/db-ts-npm-test'

function main() {
    const app = new Koa();
    exportsFunc(app,{"host":"10.0.16.25"});
    app.listen('8889');
}
main();

Reference

exportFunc(app:koa, opts?:{})

this is the entry func.
app is a koa object;
opts is your db options:

{
    host: '127.0.0.1',
    port: 3307,
    username: 'sunny_man',
    password: 'qwer-sunnydev',
    database: 'cleaner',
}

you can revise the default value to match your local db(only mysql), if not defined, the value will use the default value(above all).

API Reference

/api/user/login

/api/user/register

/api/user/revise

...

Use Token

all apis except for user-related need token verify
set header {token:tokenValue} (if login success, token will be sent back, expire time 60s)

Readme

Keywords

Package Sidebar

Install

npm i @jxding/db-ts-npm-test

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

81.4 kB

Total Files

43

Last publish

Collaborators

  • jxding