v.1.0.0. initial push of license-lib
This commit is contained in:
11
example/client-example.js
Normal file
11
example/client-example.js
Normal file
@ -0,0 +1,11 @@
|
||||
// example/client-example.js
|
||||
const axios = require('axios');
|
||||
|
||||
(async () => {
|
||||
const { data } = await axios.post('http://localhost:3000/validate-license', {
|
||||
userId: 'user123',
|
||||
licenseKey: 'your_license_key_here'
|
||||
});
|
||||
|
||||
console.log('License Valid:', data.valid);
|
||||
})();
|
13
example/server-example.js
Normal file
13
example/server-example.js
Normal file
@ -0,0 +1,13 @@
|
||||
// example/server-example.js
|
||||
const axios = require('axios');
|
||||
|
||||
(async () => {
|
||||
const { data } = await axios.post('http://localhost:3000/generate-license', {
|
||||
userId: 'user123',
|
||||
licenseType: 'subscription',
|
||||
tier: 'pro',
|
||||
validUntil: '2024-12-31'
|
||||
});
|
||||
|
||||
console.log('Generated License:', data.licenseKey);
|
||||
})();
|
Reference in New Issue
Block a user