feat: initialize thoughts-frontend with Next.js, TypeScript, and ESLint
- Add ESLint configuration for Next.js and TypeScript support. - Create Next.js configuration file with standalone output option. - Initialize package.json with scripts for development, build, and linting. - Set up PostCSS configuration for Tailwind CSS. - Add SVG assets for UI components. - Create TypeScript configuration for strict type checking and module resolution.
This commit is contained in:
24
thoughts-backend/app/src/config.rs
Normal file
24
thoughts-backend/app/src/config.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
pub struct Config {
|
||||
pub db_url: String,
|
||||
pub host: String,
|
||||
pub port: u32,
|
||||
pub prefork: bool,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn from_env() -> Config {
|
||||
Config {
|
||||
db_url: std::env::var("DATABASE_URL").expect("DATABASE_URL is not set in .env file"),
|
||||
host: std::env::var("HOST").expect("HOST is not set in .env file"),
|
||||
port: std::env::var("PORT")
|
||||
.expect("PORT is not set in .env file")
|
||||
.parse()
|
||||
.expect("PORT is not a number"),
|
||||
prefork: std::env::var("PREFORK").is_ok_and(|v| v == "1"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_server_url(&self) -> String {
|
||||
format!("{}:{}", self.host, self.port)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user