mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 01:49:10 +00:00
first sync
This commit is contained in:
parent
5d6f382c8a
commit
a4acc441ea
52 changed files with 28315 additions and 0 deletions
3
Server/api/auth.js
Normal file
3
Server/api/auth.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
module.exports = R => {
|
||||
|
||||
}
|
20
Server/api/index.js
Normal file
20
Server/api/index.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const log = new (require('../logger'))('api/index')
|
||||
const glob = require('glob')
|
||||
|
||||
module.exports = async (router, ctx) => {
|
||||
const apis = glob.sync('./api/**/!(index).js')
|
||||
log.debug('found apis', apis)
|
||||
|
||||
for (let a of apis) {
|
||||
if (a.endsWith('_test.js') !== null && process.env.NODE_ENV !== 'development') {
|
||||
log.debug(`skipping ${a}`)
|
||||
continue
|
||||
}
|
||||
log.debug(`mounting ${a}`)
|
||||
try {
|
||||
require(a.replace('api/', ''))(router, ctx)
|
||||
} catch (e) {
|
||||
log.error(`couldn't mount ${a}`, e)
|
||||
}
|
||||
}
|
||||
}
|
6
Server/api/servers.js
Normal file
6
Server/api/servers.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
module.exports = (R, $) => {
|
||||
R.get('/api/servers', (ctx) => {
|
||||
ctx.body = 'hi'
|
||||
console.log($)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue