Marvel API is a project that calling Marvel Server to get characters information
- Download the project from github.
- Download REDIS for windows here
The project is using Windows version to execute. The redis is using localhost:6379 by default.
The application will do get all characters ID and get character by ID that provided from Marvel Server.
{
"host": "localhost",
"port": 8080,
"redis":{
"host": "localhost",
"port":6379
},
"logFilePath": "",
"cacheTTL": 30000
}
host is the address of the http server.
port is the port number.
redis is the configuration section for REDIS server, it has host and port too.
logFilePath is the folder path to specify where the logs.txt is going to put.
cacheTTL is the cache time (SECONDS) that saved in REDIS server, it expires in the key in REDIS server in X SECONDS.
** Not specifying logFilePath will use current directory of the executable as the log output folder.
- Extract the downloaded REDIS server and nagivate to the 64bit folder, double click redis-server.exe to start the server.
- Run the script below to start the application.
./marvel.exe ./config.json {publickey} {privatekey}
In the project folder /integration_test, execute the command below:-
go run .
It will print out the list of the characterIds and 1 random character information get from the characterIds.