Announcements are properly implemented (yay)
This commit is contained in:
parent
8e703ecd3f
commit
312089c58d
4 changed files with 12 additions and 2 deletions
5
index.js
5
index.js
|
@ -14,6 +14,7 @@ const assetPath = path.join(__dirname, "assets")
|
|||
const configPath = path.join(__dirname, 'config')
|
||||
|
||||
const configFile = path.join(configPath, "config.json")
|
||||
const announcementFile = path.join(configPath, "announcement.html")
|
||||
|
||||
if (!fs.existsSync(configPath)) {
|
||||
fs.mkdirSync(configPath)
|
||||
|
@ -23,6 +24,10 @@ if (!fs.existsSync(configFile)) {
|
|||
fs.writeFileSync(configFile, fs.readFileSync(path.join(assetPath, "defaults/config.json")))
|
||||
}
|
||||
|
||||
if (!fs.existsSync(announcementFile)) {
|
||||
fs.writeFileSync(announcementFile, ``)
|
||||
}
|
||||
|
||||
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json')))
|
||||
|
||||
app.listen(PORT, () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue