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.*
|
.pnp.*
|
||||||
|
|
||||||
|
|
||||||
container-data/
|
container-data
|
||||||
|
|
@ -4,8 +4,15 @@ const sequelize = new Sequelize({
|
||||||
dialect: 'sqlite',
|
dialect: 'sqlite',
|
||||||
storage: './data/database.sqlite',
|
storage: './data/database.sqlite',
|
||||||
define: {
|
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;
|
module.exports = sequelize;
|
||||||
|
|
@ -3,6 +3,7 @@ version: '3'
|
||||||
services:
|
services:
|
||||||
express:
|
express:
|
||||||
build: .
|
build: .
|
||||||
|
user: "${UID:-1000}:${GID:-1000}"
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
8
index.js
8
index.js
|
|
@ -9,14 +9,6 @@ const SessionNpubbed = require('./models/SessionNpubbed');
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
|
|
||||||
sequelize.sync()
|
|
||||||
.then(() => {
|
|
||||||
console.log('Database synced');
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error('Error syncing the database:', err);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ const SessionNpubbed = sequelize.define('SessionNpubbed', {
|
||||||
sessionUuid: {
|
sessionUuid: {
|
||||||
type: DataTypes.UUID,
|
type: DataTypes.UUID,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
unique: true,
|
|
||||||
},
|
},
|
||||||
npub: {
|
npub: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
"start:containers": "docker compose up -d --build",
|
"start:containers": "docker compose up -d --build",
|
||||||
"stop:containers": "docker compose down",
|
"stop:containers": "docker compose down",
|
||||||
|
"purge-dev-data": "rm -rf ./container-data",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue