mirror of
				https://github.com/taigrr/shorturl
				synced 2025-01-18 04:03:16 -08:00 
			
		
		
		
	Remove fqdn config (not needed at this time)
This commit is contained in:
		
							parent
							
								
									3380bc5e65
								
							
						
					
					
						commit
						8ff215fdb6
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1 @@ | ||||
| shorturl | ||||
| @ -10,12 +10,4 @@ func TestZeroConfig(t *testing.T) { | ||||
| 	assert := assert.New(t) | ||||
| 
 | ||||
| 	cfg := Config{} | ||||
| 	assert.Equal(cfg.FQDN, "") | ||||
| } | ||||
| 
 | ||||
| func TestConfig(t *testing.T) { | ||||
| 	assert := assert.New(t) | ||||
| 
 | ||||
| 	cfg := Config{FQDN: "bar.com"} | ||||
| 	assert.Equal(cfg.FQDN, "bar.com") | ||||
| } | ||||
|  | ||||
							
								
								
									
										5
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.go
									
									
									
									
									
								
							| @ -17,18 +17,13 @@ func main() { | ||||
| 		config string | ||||
| 		dbpath string | ||||
| 		bind   string | ||||
| 		fqdn   string | ||||
| 	) | ||||
| 
 | ||||
| 	flag.StringVar(&config, "config", "", "config file") | ||||
| 	flag.StringVar(&dbpath, "dbpth", "urls.db", "Database path") | ||||
| 	flag.StringVar(&bind, "bind", "0.0.0.0:8000", "[int]:<port> to bind to") | ||||
| 	flag.StringVar(&fqdn, "fqdn", "localhost", "FQDN for public access") | ||||
| 	flag.Parse() | ||||
| 
 | ||||
| 	// TODO: Abstract the Config and Handlers better | ||||
| 	cfg.FQDN = fqdn | ||||
| 
 | ||||
| 	var err error | ||||
| 	db, err = bolt.Open(dbpath, 0600, nil) | ||||
| 	if err != nil { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user