stuffy stuff
This commit is contained in:
parent
faee3ca0ea
commit
2c1c1bd774
6 changed files with 12 additions and 12 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -136,4 +136,4 @@ dist
|
|||
.pnp.*
|
||||
|
||||
|
||||
container-data/
|
||||
container-data
|
||||
|
|
@ -4,8 +4,15 @@ const sequelize = new Sequelize({
|
|||
dialect: 'sqlite',
|
||||
storage: './data/database.sqlite',
|
||||
define: {
|
||||
timestamps: false
|
||||
timestamps: false,
|
||||
freezeTableName: true
|
||||
},
|
||||
});
|
||||
|
||||
sequelize.sync().then(() => {
|
||||
console.log('Database synced');
|
||||
}).catch(err => {
|
||||
console.error('Error syncing the database:', err);
|
||||
});
|
||||
|
||||
module.exports = sequelize;
|
||||
|
|
@ -3,6 +3,7 @@ version: '3'
|
|||
services:
|
||||
express:
|
||||
build: .
|
||||
user: "${UID:-1000}:${GID:-1000}"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
|
|
|
|||
8
index.js
8
index.js
|
|
@ -9,14 +9,6 @@ const SessionNpubbed = require('./models/SessionNpubbed');
|
|||
const app = express();
|
||||
const port = 3000;
|
||||
|
||||
sequelize.sync()
|
||||
.then(() => {
|
||||
console.log('Database synced');
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Error syncing the database:', err);
|
||||
});
|
||||
|
||||
app.use(cookieParser());
|
||||
|
||||
app.use(express.json());
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ const SessionNpubbed = sequelize.define('SessionNpubbed', {
|
|||
sessionUuid: {
|
||||
type: DataTypes.UUID,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
},
|
||||
npub: {
|
||||
type: DataTypes.STRING,
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@
|
|||
"start": "node index.js",
|
||||
"start:containers": "docker compose up -d --build",
|
||||
"stop:containers": "docker compose down",
|
||||
"purge-dev-data": "rm -rf ./container-data",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue