Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
icai authored Nov 28, 2024
1 parent 35231a9 commit 7528e22
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
30 changes: 30 additions & 0 deletions data/config.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const mysql = {
host: {mysql.host},
port: {mysql.port},
username: {mysql.username},
password: {mysql.password},
database: {mysql.database},
prefix: {mysql.prefix},
};

export const redis = {
host: {redis.host},
port: {redis.port},
password: {redis.password},
};

export const upload = {
storagePath: {upload.storagePath},
maxSize: {upload.maxSize},
allowedTypes: {upload.allowedTypes},
};

export const cookie = {
prefix: {cookie.prefix},
domain: {cookie.domain},
path: {cookie.path},
};

export const password = {
salt: {password.salt},
};
30 changes: 30 additions & 0 deletions data/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
export const mysql = {
host: '127.0.0.1',
port: '3306',
username: 'root',
password: 'root123456',
database: 'nuecmstest',
prefix: 'nc_',
};

export const redis = {
host: '127.0.0.1',
port: '6379',
password: '',
};

export const upload = {
storagePath: '/upload',
maxSize: 10485760,
allowedTypes: ['image/jpeg', 'image/png'],
};

export const cookie = {
prefix: 'ns',
domain: '',
path: '/',
};

export const password = {
salt: '103929ef',
};
23 changes: 23 additions & 0 deletions data/install.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

INSERT INTO users (username, email) VALUES
('john_doe', 'john@example.com'),
('jane_smith', 'jane@example.com');

CREATE TABLE IF NOT EXISTS products (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
price DECIMAL(10, 2) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

INSERT INTO products (name, price) VALUES
('Product A', 19.99),
('Product B', 29.99),
('Product C', 39.99);

0 comments on commit 7528e22

Please sign in to comment.