Initial commit 🍀
This commit is contained in:
commit
b3f42e62af
405 changed files with 31017 additions and 0 deletions
10
src/api/models/user.ts
Normal file
10
src/api/models/user.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
const collection = global.db.collection('users');
|
||||
|
||||
collection.createIndex('username');
|
||||
collection.createIndex('token');
|
||||
|
||||
export default collection;
|
||||
|
||||
export function validateUsername(username: string): boolean {
|
||||
return /^[a-zA-Z0-9\-]{3,20}$/.test(username);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue