2022.12.29 - Init
This commit is contained in:
parent
f5e6a52777
commit
59ce5e1963
5 changed files with 66 additions and 33 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
node_modules
|
node_modules
|
||||||
|
package-lock.json
|
22
README.md
22
README.md
|
@ -1,19 +1,7 @@
|
||||||
|
# Warning
|
||||||
|
|
||||||
|
This version didn't work, this is a work in project, you can use quickmap.db util we finish.
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
|
|
||||||
A quick-deploy database server
|
A quick-deploy database server
|
||||||
|
|
||||||
installation:
|
|
||||||
- download the code from [here](https://github.com/FIUSdevelopment/database-server/archive/refs/tags/1.0.0.zip)
|
|
||||||
- change the password in password.js (it need to be an array)
|
|
||||||
- for start do npm start
|
|
||||||
|
|
||||||
Save data in in ./data/database.json
|
|
||||||
|
|
||||||
This is the link:
|
|
||||||
|
|
||||||
ip://api/<auth-code>/database to get all db
|
|
||||||
|
|
||||||
ip://api/<auth-code>/database/<name> search name in the database
|
|
||||||
|
|
||||||
ip://api/<auth-code>/database/<name>/set/<value> set a name's value in the database
|
|
||||||
|
|
||||||
ip://api/<auth-code>/database/<name>/remove remove <name> in the database
|
|
||||||
|
|
32
index.js
32
index.js
|
@ -0,0 +1,32 @@
|
||||||
|
var colors = require('colors');
|
||||||
|
var readlineSync = require('readline-sync');
|
||||||
|
var server = require('./src/server.js');
|
||||||
|
server('gui')
|
||||||
|
|
||||||
|
class mitdb {
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @param type This can be 'client' or 'server'
|
||||||
|
* @param link If type = client, this is the server address (with the port), if type = server, this is the port
|
||||||
|
* @example (client) http://0.0.0.0:12934
|
||||||
|
* @example (server) 12934
|
||||||
|
*/
|
||||||
|
|
||||||
|
constructor (type, link) {
|
||||||
|
this.type = type;
|
||||||
|
this.link = link;
|
||||||
|
if (type == 'client') {
|
||||||
|
|
||||||
|
} else if (type == 'server') {
|
||||||
|
server('api')
|
||||||
|
} else {
|
||||||
|
throw new Error('Type is required')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
server
|
||||||
|
}
|
||||||
|
|
||||||
|
module.export = mitdb
|
||||||
|
/*
|
||||||
|
{}
|
||||||
|
*/
|
28
package.json
28
package.json
|
@ -1,29 +1,27 @@
|
||||||
{
|
{
|
||||||
"name": "@fiusdevelopment/mit.db",
|
"name": "mit.db",
|
||||||
"version": "0.0.1",
|
"version": "2022.12.29",
|
||||||
"description": "A QuickDeploy Database Host",
|
"description": "An online server for quickmap.db",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm start"
|
"test": "node index.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/FIUSDevelopment/mit-db.git"
|
"url": "git+https://github.com/ThunderNetworkRaD/mit.db.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"database",
|
"Database"
|
||||||
"javascript",
|
|
||||||
"nodejs",
|
|
||||||
"node.js",
|
|
||||||
"quickmap.db"
|
|
||||||
],
|
],
|
||||||
"author": "FIUS Development | Killer Boss Original",
|
"author": "Thunder Network RaD | Killer Boss Original",
|
||||||
"license": "SEE LICENSE IN LICENSE.txt",
|
"license": "ISC",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/FIUSDevelopment/mit-db/issues"
|
"url": "https://github.com/ThunderNetworkRaD/mit.db/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/FIUSDevelopment/mit-db#readme",
|
"homepage": "https://github.com/ThunderNetworkRaD/mit.db#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fiusdevelopment/map.db": "^1.0.2"
|
"colors": "^1.4.0",
|
||||||
|
"quickmap.db": "^2022.12.29",
|
||||||
|
"readline-sync": "^1.4.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
src/server.js
Normal file
14
src/server.js
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*module.exports = function (interface) {
|
||||||
|
if (interface == 'gui') {
|
||||||
|
async function home() {
|
||||||
|
std.cin('MitDB >'.red)
|
||||||
|
.then((cmd) => {
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
{}
|
||||||
|
*/
|
Loading…
Reference in a new issue