Setting up an AWS CDK GitHub Actions pipeline for a Spring Boot app
Using Github Actions, AWS CDK, Node.js, and Docker to deploy a Spring Boot app.
Hey, I'm Anton, a software developer based in Tallinn. I work with front-end, back-end, database, and infrastructure technologies. In my free time, I like to play video games, enjoy doing fitness, read books and study to get better at what I do.
func main() {
url := "https://azdanov.dev/api/login"
postBody, _ := json.Marshal(map[string]string{
"username": "admin",
"password": "secret",
})
responseBody := bytes.NewBuffer(postBody)
response, err := http.Post(url, "application/json", responseBody)
if err != nil {
log.Fatal(err)
}
defer response.Body.Close()
body, err := ioutil.ReadAll(response.Body)
if err != nil {
log.Fatal(err)
}
log.Println(string(body))
}
const url = "https://azdanov.dev/api/login";
const data = { username: "admin", password: "secret" };
fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
})
.then((response) => response.json())
.then((data) => {
console.log("Success:", data);
})
.catch((error) => {
console.error("Error:", error);
});
using (var client = new RestClient("https://azdanov.dev/api/login")) {
JObject json = new JObject();
json.Add("username", "admin");
json.Add("password", "secret");
var request = new RestRequest(Method.POST);
request.AddStringBody(json.ToString(), DataFormat.Json);
var response = client.Execute(request);
var jsonResult = JObject.Parse(response.Content);
Console.WriteLine(jsonResult);
}
SELECT
id AS id,
username AS username,
email AS email,
created_at AS created_at,
updated_at AS updated_at,
roles.name AS role
FROM users
INNER JOIN user_roles ON users.id = user_roles.user_id
INNER JOIN roles ON user_roles.role_id = roles.id
WHERE username = 'admin'
AND password = '$2a$10$T6dqyjVcnXx975Il7XMvM.jFr.QjupMeTi2HOfU2g6s4G2yGm5MCi'
LIMIT 1;
public class Login {
private final static URL login = new URL("https://azdanov.dev/api/login");
public static void main(String[] args) {
URLConnection connection = login.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
try (OutputStream os = connection.getOutputStream()) {
byte[] input = "{\"username\":\"admin\",\"password\":\"secret\"}".getBytes("utf-8");
os.write(input, 0, input.length);
}
try (BufferedReader br = new BufferedReader(
new InputStreamReader(connection.getInputStream(), "utf-8"))) {
StringBuilder response = new StringBuilder();
String responseLine = null;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
}
}
Using Github Actions, AWS CDK, Node.js, and Docker to deploy a Spring Boot app.
A book called Stratospheric about learning AWS CDK for a Spring Boot app that I'm going through.
Sharing my experience of passing the Microsoft Certified: Azure Developer Associate (AZ-204) exam.
Sharing my experience of passing the Microsoft Certified: Azure Administrator Associate (AZ-104) exam.