Install and run ArangoDB using Docker
Programming for beginners
by
1w ago
Step 1: Install Docker If you don't already have Docker installed, you can download and install it from the Docker website.   Step 2: Pull the ArangoDB Docker Image Open your terminal and pull the latest ArangoDB Docker image: docker pull arangodb   Step 3: Run ArangoDB in a Docker Container Once the image is pulled, you can run ArangoDB in a Docker container. The following command will run ArangoDB and map the necessary ports: docker run -e ARANGO_ROOT_PASSWORD=mysecretpassword -d --name arangodb -p 8529:8529 arangodb Replace mysecretpassword with your desired root password for Ara ..read more
Visit website
Validating Request Headers in Javalin
Programming for beginners
by
3w ago
Using Context.headerAsClass() method, we can validate the request headers. Example Integer expireAfter = ctx .headerAsClass("expire_after_in_minutes", Integer.class) .check(time -> time <= 10 && time > 5, "Expiry time should be between 5 and 10 inclusive") .getOrDefault(8); Find the below working application.   Step 1: Create new maven project ‘javalin-validate-request-header’.   Step 2: Update pom.xml with maven dependenices.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance ..read more
Visit website
Accessing Request Headers by Name in Javalin
Programming for beginners
by
3w ago
Context.header() method return the request header by name. Example String expireAfter = ctx.header("expire_after"); Find the below working application.   Step 1: Create new maven project ‘javalin-read-request-header-by-name’.   Step 2: Update pom.xml with maven dependencies.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <g ..read more
Visit website
Big Ball Of Mud and how not to do the things?
Programming for beginners
by
1M ago
Big Ball Of Mud talks about a software system that has evolved over time without a clear, or consistent architectural structure, which results in a codebase that is difficult to understand, maintain, and extend.   Let me explain this with an example of the Book-My-Ticket application, which is responsible for booking bus tickets. Imagine you want to develop a bus ticketing platform where agents are tasked with booking bus tickets on behalf of users. In this scenario, a user would approach an agent to book a ticket. The agent would then use the Book-My-Ticket application to complete the boo ..read more
Visit website
Quick tutorial on GCP Bucket
Programming for beginners
by
1M ago
  Google Cloud Platform (GCP) provides 'Google Cloud Storage' service, it allows you to store and retrieve any amount of data at any time. You can use 'Google Cloud Storage' service to store and retrieve any amount of data at any time.   Key Concepts a.   Buckets: Containers to store objects. b.   Objects: The individual pieces of data that you store in buckets.   Why GCP Bucket? Use GCP Buckets when you need a scalable, secure, and cost-effective storage solution that integrates well with other cloud services and supports a wide range of use cases. Whether y ..read more
Visit website
Reading a Request Cookie by Name in Javalin
Programming for beginners
by
1M ago
Context#cookie method return the value of request cookie by name. Example String pingToken = ctx.cookie("pingToken"); Find the below working application.   Step 1: Create new maven project ‘javalin-read-request-cookie-by-name’.   Step 2: Update pom.xml with maven dependencies.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> < ..read more
Visit website
How to Get Request Content Type in Javalin?
Programming for beginners
by
1M ago
Context#contentType method return the request content type. Example ctx.contentType() Find the below working application.   Step 1: Create new maven project ‘javalin-request-body-content-type’.   Step 2: Update pom.xml with maven dependencies.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.sample.app</gro ..read more
Visit website
Determining Request Body Content Length in Javalin
Programming for beginners
by
1M ago
Context#contentLength() method return the content length of the request body in bytes. Example ctx.contentLength() Find the below working application.   Step 1: Create new maven project ‘javalin-request-body-content-length’.   Step 2: Update pom.xml with maven dependencies.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <gr ..read more
Visit website
Reading Request Attributes as a Map in Javalin
Programming for beginners
by
1M ago
Context#attributeMap return a map of all attributes on the request. Example Map<String, Object> attributeMap = ctx.attributeMap(); Find the below working application.   Step 1: Create new maven project ‘javalin-read-all-request-attributes’.   Step 2: Update pom.xml with maven dependencies.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVers ..read more
Visit website
Javalin: Get the request attribute or compute it based on the context if absent
Programming for beginners
by
1M ago
Context#attributeOrCompute method get an attribute or compute it based on the context if absent. Example String name = (String) ctx.attributeOrCompute("name", context -> { return context.attribute("default_name"); }); Find the below working application.   Step 1: Create new maven project ‘javalin-compute-attribute-demo’.   Step 2: Update pom.xml with maven dependencies.   pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://ma ..read more
Visit website

Follow Programming for beginners on FeedSpot

Continue with Google
Continue with Apple
OR