Skip to content

Commit

Permalink
config: convert js to ts
Browse files Browse the repository at this point in the history
Create a config.ts model from the config.js model.
  • Loading branch information
Mersho committed Sep 6, 2023
1 parent 4753432 commit fa509be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
9 changes: 0 additions & 9 deletions models/config.js

This file was deleted.

17 changes: 17 additions & 0 deletions models/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import mongoose, { Document, Schema } from 'mongoose';

export interface IConfig extends Document {
maintenance: boolean;
node_status: string;
node_uri: string;
}


const configSchema = new Schema<IConfig>({
maintenance: { type: Boolean, default: false },
node_status: { type: String, default: 'down' },
node_uri: { type: String },
});


module.exports = mongoose.model<IConfig>('Config', configSchema);

0 comments on commit fa509be

Please sign in to comment.