mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
feat(server): add field "identifier"
I'm going to replace the function of "main.js".
This commit is contained in:
parent
5bf53028ef
commit
4e434a2691
@ -22,6 +22,7 @@ const VERSION_CHECK_RESULT = {
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* identifier?: string,
|
||||
* route: string,
|
||||
* module: any
|
||||
* }} ModuleDefinition
|
||||
@ -70,10 +71,11 @@ async function getModulesDefinitions(modulePath, specificRoute) {
|
||||
.reverse()
|
||||
.filter((file) => file.endsWith('.js'))
|
||||
.map((file) => {
|
||||
const identifier = file.split('.').shift()
|
||||
const route = parseRoute(file)
|
||||
const module = require(path.join(modulePath, file))
|
||||
|
||||
return { route, module }
|
||||
return { identifier, route, module }
|
||||
})
|
||||
|
||||
return modules
|
||||
|
Loading…
x
Reference in New Issue
Block a user