只需要一台 VPS,搭建自己的 Serverless Database ☝️

    1. import easyDB from 'mm-db';
    2. // Create a db instance
    3. const db = easyDB({
    4. server: '127.3.4.23',
    5. database: 'b988472d-500a-4e8c-a430-1d735a23e348',
    6. token: 'a437bcd9-c4b8-458a-a87e-27e6dd02d106'
    7. })
    8. // Use a callback
    9. db.Put('myKey', {some: 'data'}, (value, err) => {})
    10. db.Get('myKey', (value, err) => {})
    11. db.Delete('myKey', (value, err) => {})
    12. db.List((value, err) => {})
    13. // Or, async/await
    14. let value, values
    15. async (() => {
    16. value = await db.Put('myKey', {some: 'data'})
    17. value = await db.Get('myKey')
    18. value = await db.Delete('myKey')
    19. values = await db.List()
    20. })()