Content Migration from websites repo
This commit is contained in:
parent
f6eb9794a9
commit
f58a45df06
24 changed files with 7575 additions and 1 deletions
pages/api
15
pages/api/navbar.tsx
Normal file
15
pages/api/navbar.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import fsPromises from 'fs/promises'
|
||||
import path from 'path'
|
||||
|
||||
export default async function Navbar(req: any, res: any) {
|
||||
try {
|
||||
const filePath = path.join(process.cwd(), '/confs/navbar.json')
|
||||
const jsonData = await fsPromises.readFile(filePath)
|
||||
const data = JSON.parse(jsonData.toString())
|
||||
res.status(200).json(data)
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
res.status(500).json({error: 'Error reading data'})
|
||||
}
|
||||
}
|
15
pages/api/servers.tsx
Normal file
15
pages/api/servers.tsx
Normal file
|
@ -0,0 +1,15 @@
|
|||
import fsPromises from 'fs/promises'
|
||||
import path from 'path'
|
||||
|
||||
export default async function Servers(req: any, res: any) {
|
||||
try {
|
||||
const filePath = path.join(process.cwd(), '/confs/servers.json')
|
||||
const jsonData = await fsPromises.readFile(filePath)
|
||||
const data = JSON.parse(jsonData.toString())
|
||||
res.status(200).json(data)
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
res.status(500).json({error: 'Error reading data'})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue