parent
6d35b93d9b
commit
b044595633
@ -0,0 +1,3 @@ |
||||
auth.json |
||||
package-lock.json |
||||
node_modules/ |
@ -0,0 +1,10 @@ |
||||
const {model, Schema} = require("mongoose"); |
||||
|
||||
module.exports = (connection) => connection.model('users', new Schema({ |
||||
name: String, |
||||
id: {type: String, unique: true}, |
||||
discord: {type: String, unique: true}, |
||||
permissions: [String], |
||||
password: String, |
||||
apiToken: {type: String, unique: true} |
||||
})); |
@ -0,0 +1,10 @@ |
||||
const fs = require('fs'); |
||||
|
||||
module.exports = app => { |
||||
app.db.models = {ani: {}, bot: {}}; |
||||
fs.readdirSync('../db/ani').filter(file => file.endsWith('.js')).forEach(file => { |
||||
const model = require(`./ani/${file}`)(app.db.ani); |
||||
app.db.models.ani[model.modelName] = model; |
||||
}); |
||||
console.log(`Built ${Object.keys(app.db.models.ani).length} models\n`); |
||||
}; |
@ -0,0 +1,22 @@ |
||||
{ |
||||
"name": "natsuki-api", |
||||
"version": "1.0.0", |
||||
"main": "index.js", |
||||
"dependencies": { |
||||
"bcrypt": "^5.1.0", |
||||
"body-parser": "^1.20.1", |
||||
"cors": "^2.8.5", |
||||
"discord.js": "^14.7.1", |
||||
"express": "^4.18.2", |
||||
"helmet": "^6.0.1", |
||||
"jsonwebtoken": "^9.0.0", |
||||
"mongoose": "^6.8.4" |
||||
}, |
||||
"scripts": { |
||||
"test": "echo \"Error: no test specified\" && exit 1" |
||||
}, |
||||
"keywords": [], |
||||
"author": "wubzygd", |
||||
"license": "ISC", |
||||
"description": "" |
||||
} |
Loading…
Reference in new issue