mirror of
https://github.com/expo/node-vault.git
synced 2026-11-27 16:45:28 -10:00
15 lines
534 B
JavaScript
15 lines
534 B
JavaScript
// file: example/secret_mounts.js
|
|
|
|
process.env.DEBUG = 'node-vault'; // switch on debug mode
|
|
|
|
const vault = require('./../src/index')();
|
|
|
|
vault.mounts()
|
|
.then(() => vault.mount({ mount_point: 'test', type: 'generic', description: 'just a test' }))
|
|
.then(() => vault.write('test/hello', { value: 'world', lease: '1s' }))
|
|
.then(() => vault.remount({ from: 'test', to: 'test2' }))
|
|
.then(() => vault.read('test2/hello'))
|
|
.then(console.log)
|
|
.then(() => vault.unmount({ mount_point: 'test2' }))
|
|
.catch((err) => console.error(err.message));
|