The Definitive Guide to AdonisJs: Building Node.js Applications with JavaScript Christopher Pitt All Chapters Instant Download
The Definitive Guide to AdonisJs: Building Node.js Applications with JavaScript Christopher Pitt All Chapters Instant Download
com
https://textbookfull.com/product/the-definitive-guide-to-
adonisjs-building-node-js-applications-with-javascript-
christopher-pitt/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/the-definitive-guide-to-jsf-in-java-
ee-8-building-web-applications-with-javaserver-faces-bauke-scholtz/
textboxfull.com
https://textbookfull.com/product/javascript-the-definitive-guide-7th-
edition-david-flanagan/
textboxfull.com
https://textbookfull.com/product/building-web-and-mobile-arcgis-
server-applications-with-javascript-lewin/
textboxfull.com
Guide to Scientific Computing in C Pitt-Francis
https://textbookfull.com/product/guide-to-scientific-computing-in-c-
pitt-francis/
textboxfull.com
https://textbookfull.com/product/understanding-ecmascript-6-the-
definitive-guide-for-javascript-developers-1st-edition-nicholas-c-
zakas/
textboxfull.com
https://textbookfull.com/product/practical-bot-development-designing-
and-building-bots-with-node-js-and-microsoft-bot-framework-szymon-
rozga/
textboxfull.com
https://textbookfull.com/product/pentesting-azure-applications-the-
definitive-guide-to-testing-and-securing-deployments-1st-edition-matt-
burrough/
textboxfull.com
https://textbookfull.com/product/guide-to-scientific-computing-
in-c-2nd-edition-joe-pitt-francis/
textboxfull.com
The Definitive
Guide to AdonisJs
Building Node.js Applications with JavaScript
—
Christopher Pitt
The Definitive Guide to
AdonisJs
Building Node.js Applications
with JavaScript
Christopher Pitt
The Definitive Guide to AdonisJs: Building Node.js Applications with JavaScript
Christopher Pitt
Cape Town, Western Cape, South Africa
Acknowledgments��������������������������������������������������������������������������������������������������� xi
Introduction����������������������������������������������������������������������������������������������������������� xiii
Chapter 2: Routing�������������������������������������������������������������������������������������������������� 11
What Are Routes?������������������������������������������������������������������������������������������������������������������������ 11
Planning Routes�������������������������������������������������������������������������������������������������������������������������� 12
Defining Routes��������������������������������������������������������������������������������������������������������������������������� 14
Testing Routes���������������������������������������������������������������������������������������������������������������������������� 15
Defining Route Parameters��������������������������������������������������������������������������������������������������������� 20
Summary������������������������������������������������������������������������������������������������������������������������������������ 26
Chapter 3: Views���������������������������������������������������������������������������������������������������� 27
Creating Views���������������������������������������������������������������������������������������������������������������������������� 27
Registering the View Provider����������������������������������������������������������������������������������������������� 28
Creating Layouts������������������������������������������������������������������������������������������������������������������������� 29
Learning Template Syntax����������������������������������������������������������������������������������������������������������� 34
Interpolation�������������������������������������������������������������������������������������������������������������������������� 35
iii
Table of Contents
Conditionals��������������������������������������������������������������������������������������������������������������������������� 36
Loops������������������������������������������������������������������������������������������������������������������������������������� 37
Partials���������������������������������������������������������������������������������������������������������������������������������� 38
Yield��������������������������������������������������������������������������������������������������������������������������������������� 38
Functions������������������������������������������������������������������������������������������������������������������������������� 39
Summary������������������������������������������������������������������������������������������������������������������������������������ 40
Chapter 4: Requests����������������������������������������������������������������������������������������������� 41
Updating Tests����������������������������������������������������������������������������������������������������������������������������� 41
Understanding Requests������������������������������������������������������������������������������������������������������������� 47
Getting Parameters���������������������������������������������������������������������������������������������������������������� 49
Getting Headers and Cookies������������������������������������������������������������������������������������������������ 50
Getting “accepts” and “language”���������������������������������������������������������������������������������������� 50
Finding Out More������������������������������������������������������������������������������������������������������������������� 51
Responding to POST, PUT, PATCH, and DELETE���������������������������������������������������������������������� 51
Summary������������������������������������������������������������������������������������������������������������������������������� 59
Chapter 5: Responses��������������������������������������������������������������������������������������������� 61
Sending Simple Responses�������������������������������������������������������������������������������������������������������� 61
Sending JSON Responses����������������������������������������������������������������������������������������������������������� 62
Working with Cookies����������������������������������������������������������������������������������������������������������������� 64
Redirecting Users������������������������������������������������������������������������������������������������������������������������ 64
Responding with Attachments���������������������������������������������������������������������������������������������������� 66
Extending with Macros��������������������������������������������������������������������������������������������������������������� 66
Summary������������������������������������������������������������������������������������������������������������������������������������ 70
Chapter 6: Generators��������������������������������������������������������������������������������������������� 71
Arrays: Where It All Began����������������������������������������������������������������������������������������������������������� 71
Then Came Iterators�������������������������������������������������������������������������������������������������������������������� 72
Generators���������������������������������������������������������������������������������������������������������������������������������� 75
Cooperative Multitasking������������������������������������������������������������������������������������������������������������ 76
Summary������������������������������������������������������������������������������������������������������������������������������������ 79
iv
Table of Contents
Chapter 7: Promises����������������������������������������������������������������������������������������������� 81
Reacting to Events���������������������������������������������������������������������������������������������������������������������� 81
Entering Callback Hell����������������������������������������������������������������������������������������������������������������� 82
Understanding Promises������������������������������������������������������������������������������������������������������������� 83
Using Promises with Coroutines������������������������������������������������������������������������������������������������� 84
Making Promises������������������������������������������������������������������������������������������������������������������������ 86
Bringing It Back to AdonisJs������������������������������������������������������������������������������������������������������� 88
Summary������������������������������������������������������������������������������������������������������������������������������������ 89
v
Table of Contents
vi
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 245
vii
About the Author
Christopher Pitt is a developer and writer working at Over. He usually works on
application architecture, though sometimes you’ll find him building compilers or robots.
He is also the author of several web development books and is a contributor on various
open source projects such as AdonisJs.
ix
Acknowledgments
Many people helped to make this book a reality. I’d like to thank them, in no
particular order.
Harminder and the rest of the core team have written some beautiful software.
I am continually amazed by how beautiful AdonisJs code can look. I enjoy JavaScript,
and it seems particularly suited to a framework like this. Harminder also gave insightful
technical feedback for this book.
Taylor began a wonder with Laravel. It’s clear that much of AdonisJs is inspired by
Laravel, and with good reason. Laravel kept me engaged in PHP, and AdonisJs will keep
me engaged in server-side JavaScript.
Mark, the coordinating editor, was fantastic to work with. He never got in the way
and was always helpful. That’s uncommon in his line of work. Matt, the development
editor, was similarly helpful and let me set the vision for this project, unencumbered.
These folks are a credit to Apress.
Matt, the writer, is an inspiration to me. He wrote what I consider to be the best
Laravel book on the market. Throughout this book, I sought to emulate his wisdom and
skill.
Bruno, Christian, and Wayne are good friends and supporters of my work. I miss
writing for Bruno. I miss having coffee with Christian. I will miss taking walks with
Wayne.
Liz, my love, has given me space and coffee in abundance. She is the inspiration
for the sample application, and though she finds me altogether strange, she loves me
effortlessly.
xi
Introduction
This book is designed to teach you how to use AdonisJs. To get the most out of it, you
should have a firm grasp of modern JavaScript and some knowledge of how to work with
relational databases and the command line.
I explain new and interesting bits of syntax, but this book isn’t primarily about
teaching you how to use JavaScript. It’s about teaching you how to build real applications
by using AdonisJs.
The application we’re going to build is called Threadbear. It’s a play on words,
meant to conjure up thoughts of patchy, knitted teddy bears. We’re going to make an
application through which sellers can register and upload their knitted patterns and
products. Customers will then be able to register and purchase these things.
We’re not going to focus much on design. Instead, we’re going to focus on the
mechanics of commerce applications. Beyond adding a CSS framework, everything is as
the good browser vendors intended. That said, I welcome you to add your own style to
the application
We’ll create a secure registration and login system. We’ll add profile and product
management. We’ll connect the front end to the back end by using WebSockets and
the Fetch API. We’ll design a shopping cart in React and we’ll package static files with a
custom build chain. Finally, we’ll learn how to deploy the application to a virtual server,
and install custom domains and SSL certificates.
It is my hope that by the time you are finished reading this book, you’ll know all you
need to know in order to build your online business.
xiii
CHAPTER 1
Getting Started
Deciding where to start is often the hardest part, don’t you find? In this chapter, we’re
going to get our development tools set up. We’re also going to create a new AdonisJs
application. We’ll finish up by taking a look at the folders of our application and making
a few small customizations.
Note Complex and exhaustive installation instructions are one of the easiest
ways to age a book. I’m not going to belabor the steps for every operating system
and configuration. I’m guessing you know enough about Google to find the help
you need. If you get stuck, ask me for help on Twitter (https://twitter.com/
assertchris) or e-mail ([email protected]).
I nstalling Node.js
As the name implies, AdonisJs is a JavaScript framework. There have been a few
runtimes for JavaScript on the server, but the clear winner is Node.js (https://nodejs.
org/en). You can see what the Node.js web site looks like in Figure 1-1. The latest version
of AdonisJs requires Node 8.0 or newer. That’s because it uses new language features to
make writing code easier and more expressive. We’ll learn about those later.
Node.js is relatively painless to install, despite its size and intricacy. On macOS, you
can run the following:
1
© Christopher Pitt 2018
C. Pitt, The Definitive Guide to AdonisJs, https://doi.org/10.1007/978-1-4842-3390-0_1
Chapter 1 Getting Started
You can check that Node.js is correctly installed by running the following:
node -v
npm -v
2
Chapter 1 Getting Started
This installs the command-line tool globally, which means we’ll be able to use it
from anywhere on our system. Similarly to the way we check Node.js, we can check to
see whether this tool has been successfully installed by running the following:
adonis --help
This also gives as a sneak peek at the kinds of things we can start to do to an
application. Various commands are available, from creating and running applications to
adding new functionality in existing applications.
For now, we’re just going to create a new AdonisJs application.
It’ll take a minute or two to fully install and configure the new application. The
only step I want to talk about for the moment is “generated unique APP_KEY.” AdonisJs
applications have an .env configuration file, which we can use to store sensitive
configuration variables. One of these is called APP_KEY, which is a private key unique to
the application.
Whenever text is encrypted or hashed, this value is used to seed the operation. The
same password, when hashed in two applications (with different APP_KEY values), will
result in different hashes. This is important to know because at times you might need to
compare hashes or decrypt values that have been generated using a different APP_KEY
than the one the command-line tool just made for you.
3
Chapter 1 Getting Started
Note It’s possible to reuse an APP_KEY in multiple applications, but it’s definitely
not recommended. Sharing an APP_KEY should be done only in exceptional
situations and for a limited amount of time. If you reuse keys, you’re increasing the
likelihood that all the applications reusing the key are compromised at the same time.
S
erving the Application
Now that we’ve created an application, we need a way to view it in the browser. Some
server-side languages use third-party web servers (such as Nginx or Apache) as a kind of
load balancer. PHP and Perl are examples of this.
Things work a bit differently with server-side JavaScript. The foundational example
of how to use Node.js (https://nodejs.org/en/docs/guides/getting-started-guide)
demonstrates how we can make our own HTTP server:
This is quite similar to what AdonisJs does under the hood. This means our server(s)
need to keep the Node.js HTTP script running as what is usually referred to as a daemon.
We’ll unpack that later, but for now we’ll need to make sure adonis serve is running
while we code.
As the message when we run adonis serve --dev says, we can see the new application
by loading 127.0.0.1:3333 in a web browser. We can see what this looks like in Figure 1-2.
4
Chapter 1 Getting Started
threadbear
↳ node_modules
↳ public
↳ start
↳ .env
↳ .env.example
↳ .gitignore
1
https://github.com/adonisjs/adonis-slim-app
5
Chapter 1 Getting Started
↳ ace
↳ package.json
↳ server.js
As usual, NPM (or Node Package Manager) dependencies are stored in the node_
modules folder. When we run adonis serve --dev, it’s doing little more than running
node server.js.
Static files, such as client-side stylesheets and scripts, are usually placed in the
public folder. More complex applications tend to have build chains, which take source
stylesheets and scripts and combine/compress them into smaller production versions.
AdonisJs favors convention over configuration. This means that it is designed to be
useful out of the box. Sometimes we might need to deviate from the standard configuration.
In new applications, we can do that by customizing the files in the start folder.
Let’s make a few customizations to the application. We’re going to learn about routes
in a while, but we’ll add one in the meantime. The starting routes file resembles Listing 1-1.
"use strict"
See that Route.get? We’re going to add another, as shown in Listing 1-2.
Route.get("/register", () => {
return "...form for customers to make new profiles"
})
For now, restart the serve command and go to the address you see in the terminal
window. We can see the text we entered: text that we’re returning from the route, matching
the /register path we specified.
Larger applications require more files than just the ones we have currently. You may
remember that the adonis --help command suggested quite a few make commands.
6
Chapter 1 Getting Started
We can use these to create any number of project files. Though we’re also going to learn
about them later, let’s create a controller:
Note The command-line tools create files in a predictable location. That’s not
to say that we couldn’t change the position and name of these files—just that by
default, they will always be in a predictable configuration.
Let’s make a new command so we can explore more of the starter configuration:
node ace
The output is similar to (though much less than) that of adonis --help. These
commands are similarly built, but the global adonis command has more subcommands
registered within it. ace has only the commands registered for your app.
Sometimes it’s easier not to have to specify that you want to run the command by
using node. In that case, we can make the Ace script executable:
chmod +x ace
7
Chapter 1 Getting Started
We also need to add a hash-bang (#!) to the top of the Ace script, as in Listing 1-3.
#!/usr/bin/env node
"use strict"
// ...other code
./ace
It’s not a huge improvement, but it is an interesting technique to be aware of. Hash-
bang directives (like this one) can be useful for hiding unnecessary details, such as the
binary we need to run a script, so that these kinds of stand-alone scripts are easier for
others to use.
We’re going to use this trick later, when we work out how to restart the server with
a new routing configuration. In the meantime, let’s follow the advice we received when
we created the command. Let’s change start/app.js to include the new command, as
shown in Listing 1-4.
// ...other code
const commands = [
"App/Commands/SendReminder"
]
module.exports = {
providers, aceProviders, aliases, commands
}
8
Chapter 1 Getting Started
module.exports = SendReminder
SendReminder extends the built-in Command class. Command does most of the heavy
lifting, but it does require a few properties/getters to be defined:
signature is the name by which the command will be called, but also the arguments
and extra parameters the command accepts.
description is useful when we run ./ace --help. It shows what the command does
and describes what the arguments and parameters are for.
handle is where we put all the code this command needs to use. We’re going to use it
to send reminder e-mails to our customers, but for now it can log text to the console.
We can see the results of this code in Figure 1-3.
9
Chapter 1 Getting Started
Summary
In this chapter, we installed all the requirements for AdonisJs. We created a new
application, and learned how routes and shared code (such as Ace commands) can be
configured in the files within the start folder.
We’ve touched lightly on a few parts of the AdonisJs application structure. In the next
chapter, we’re going to learn far more about defining application routes.
10
CHAPTER 2
Routing
In the previous chapter, we set up our environment and got our first look at the structure
of an AdonisJs application. Now it’s time to add HTTP endpoints to the application. This
is done by adding routes. We’ll learn about all the ways to customize routes, use the data
they hold, and respond to any request.
Route.get("/register", () => {
return "...form to make new profiles"
})
11
© Christopher Pitt 2018
C. Pitt, The Definitive Guide to AdonisJs, https://doi.org/10.1007/978-1-4842-3390-0_2
Chapter 2 Routing
We can tell a couple of things about this route, even if we remove all the code inside
() => {...}. The first is that this route responds to GET requests. There are other kinds
of requests, such as POST, PUT, DELETE, and HEAD. The second thing we can tell is that the
request should go to /register.
Routes can also have values embedded in the path, as we’ll see in this chapter.
Planning Routes
We’re going to define a few more customer routes alongside the /registration route we
already defined. Customers will need these to manage their accounts and gain access to
protected profile and product information:
• PUT /logout: PUT is similar to POST in that it’s used for a write
operation. However, whereas POST is often used to indicate that a
whole new thing is being created, PUT is often used to indicate that a
change is being made to something. As you’ll see, we use PUT when
we want to update something that has already been created.
13
Chapter 2 Routing
Note There’s a fine line between respecting a seller’s desire for privacy and
other customers’ right to access content they’ve purchased. It is right for us to
immediately delete products and customer profiles at the will of the customer. It’s
also important for us to preserve the ability to download purchased content after
a profile has been deleted or a product removed from sale. We’ll cross this bridge
when we get to it, but it’s important to remember these rights and responsibilities
when we design the application.
D
efining Routes
Now that we’ve planned the routes we’ll begin our application with, it’s time to define
them in code. We’ll begin with the profile routes, shown in Listing 2-2.
Route.get("/login", () => {
// show login form
return "GET /login"
})
Route.post("/login", () => {
// create new customer session
14
Chapter 2 Routing
Route.put("/logout", () => {
// expire current customer session
return "PUT /logout"
})
Route.get("/register", () => {
// show registration form
return "GET /register"
})
Route.post("/register", () => {
// create new customer profile
return "POST /register"
})
Route.get("/forgot-password", () => {
// show forgot password form
return "GET /forgot-password"
})
Route.post("/forgot-password", () => {
// create new password reset token and send e-mail
return "POST /forgot-password"
})
Each of these routes follows the pattern I just described. They will grow to contain
the functionality of the application, but in the meantime they just return strings. This is
immediately useful for testing, covered next.
Testing Routes
We’re going to take a brief detour from our route definitions to testing. This book has no
chapter dedicated to testing, because I believe it’s better to always be asking ourselves
how we plan to test the code we’re writing.
15
Chapter 2 Routing
There are many schools of thought when it comes to testing. I’m not going to dwell
on any of them (because we don’t have the time, and we need to stay focused), but I will
say that no one approach to testing is the best. Having any tests is better than having
none, and thinking about tests early and continuously has caused me to write better
code. I recommend this approach.
The jury is still out on which testing framework is the best. For now, we’re going to
use a framework called Mocha (https://mochajs.org). To install it, we need to run the
following command:
This gives us access to a few tools we can use for testing. Now let’s create a test file to
hold our first test, as shown in Listing 2-3.
require("dotenv").config()
16
Chapter 2 Routing
const shouldHaveMessage = (
method,
path,
message,
done,
) => {
http
.request(
{
host: process.env.HOST,
port: process.env.PORT,
method,
path,
},
response => {
let data = ""
response.on("end", () => {
assert.equal(message, data)
done()
})
},
)
.end()
}
"/login",
"GET /login",
done,
)
})
})
We begin by importing the assertions and HTTP libraries via require statements. We
also import the dotenv library and immediately call the config method. This loads all
the environment variables in our .env file so we can build a URL from the HOST and PORT
variables.
We follow this up by creating the shouldBeOk and shouldHaveMessage helper
functions. The first checks whether a request to an address returns a response with a 200
status code. This would indicate that the request returned successfully, which tells us
that the route is defined.
The shouldHaveMessage function tells us whether a request to an address returns a
message we expect. We’ve defined our routes to return simple messages that describe
their method and path, so we can use shouldHaveMessage to make sure the requests
match the messages we expect them to.
We’ve also defined our first set of tests using the describe and it functions. Mocha
provides these for us, so we don’t have to import them. We can duplicate these tests for
each route, as demonstrated in Listing 2-4.
18
Exploring the Variety of Random
Documents with Different Content
fliessen ihm zahlreiche wasserreiche Bäche zu. Er soll in der
Regenzeit ziemlich weit aufwärts mit Kanus befahrbar sein und keine
Schnellen besitzen.
Unweit Ruwenga soll eine heisse Quelle entspringen. Die
wenigen Tage, die ich am Ta n g a n yika zubrachte, sind nicht im
Stande der ziemlich reichen Litteratur über diesen See Neues
hinzuzufügen. Von früh 10 Uhr bis Sonnenuntergang wehte im
September ein kräftiger Südwind, der in dieser Jahreszeit
regelmässig auftreten soll. Das Wasser war leicht brackisch, aber
geniessbar. Nach Aussage der Eingeborenen fällt der See stark und
breite Sanddünen zeigen die Fläche, die er früher bedeckte. Auch
die von Hore und Livingstone gesehene Insel konnte ich nicht mehr
wahrnehmen.
Was die o r o g r a p h isch e G l ie d e r u n g anbelangt, so trifft man
in Ost-Ussui leicht gewellte Landschaften, die von einzelnen meist
N. N. O. verlaufenden Kämmen durchschnitten werden. Weiter
landeinwärts treten diese näher aneinander und nehmen
Plateaucharakter an. In Urundi ist das allmählich ansteigende Land
durch die Erosion in ein ziemlich regelloses Gewirre von Kuppen
verwandelt, in welchem die meridionale Kammrichtung kaum noch
erkennbar ist. Den Westrand bildet der riesige, fast 3000 m hohe
Wall der Missosi ya Mwesi, der jenseits steil nach dem
Centralafrikanischen Graben abstürzt.
Durch den Tanganyika und das Russisi-Thal, durch den Albert-
Edward- und Albert-See charakterisirt, bildet der
Ce n t r a la f r i ka n isch e G r a b e n, wie schon Dr. Ha n s Me y e r
ausgeführt, eine mehr lokale aber kaum weniger grossartige
Störungslinie als der Ostafrikanische. Die Seen sind sämmtlich
durch leicht brackisches Wasser ausgezeichnet und der Tanganyika
legitimirt sich durch die Fauna deutlich als Relicten-See. Zum
Unterschied vom ostafrikanischen Graben, bei welchem der
Westrand allein durchwegs scharf ausgeprägt ist, scheinen hier
beide Ränder in gleicher Deutlichkeit aufzutreten. Am Tanganyika
sowohl wie am Albert- und Albert-Edward-See tritt der Westrand als
schroffe Mauer auf; ebenso präsentirt sich der Ostrand im Süden als
die Missosi ya Mwesi, im Norden als Ruvensori bis über die
Schneegrenze aufragend.
Die von Suess vermuthete Aufwulstung der Grabenränder, tritt
hier bei den Randgebirgen deutlich auf. Ueberall bildet die Höhe des
Abfalls auch die Wasserscheide, auf der einen Seite die des Kongo,
auf der anderen die des Nil, dessen Ursprung sich in nächster Nähe
des Grabens befindet. Aehnlich wie der Gurui sich in der Sohle des
Ostgrabens erhebt, so ragen hier die Mfumbiro-Vulkane auf, einen
deutlichen Beweis für den Bruchcharakter dieser Senkung liefernd.
Von dem östlichen Randwall des Tanganyika zweigt jener Kamm
ab, welcher die Wasserscheide zwischen Kagera und Mlagarassi
bildet und erst steil und felsig ist, dann immer mehr abflacht. Südlich
davon sind nur niedrige Hügelzüge vorgelagert, aus welchen man in
das Flachland von Unyamwesi tritt.
Der g e o l o g isch e B a u ist durch das Vorherrschen
krystallinischer Gesteine bezeichnet; nur selten und meist an
grossen Flussläufen, wie dem Kagera und Akanyaru, werden die
liegenden plutonischen Gesteine, Granit und Diabas, durch die
Erosion blosgelegt. In Ussui und Urundi bis zum Akanyaru ist
Quarzit vorherrschend mit meist N. N. O. — S. S. W.-Streichen und
steilem W. N. W.-Fallen. Derselbe ist vielfach mergelich verwittert
und oft mit dicken Lateritmassen überlagert. Vereinzelt tritt Gneiss,
Glimmerschiefer und Urthonschiefer in gleicher Lagerung auf,
letzterer am Muhembaberg graphithaltig. In Ruanda tritt Gneiss auf,
während im südlichen Urundi wieder Quarzit vorherrscht. Auch in
Uha steht krystallinisches Gestein an, welches vielfach
eisenschüssig verwittert ist und sich an das Granitgebiet von
Unyamwesi anschliesst. —
Wahrscheinlich paläozoische Sedimente treten an einigen
Punkten Urundi's auf, Kalke fand ich nur in Uha, doch sollen solche
auch bei Ruvenga am Westufer des Tanganyika anstehen.
Das K l i ma ist in ganz auffallender Weise durch die
Wasserscheiden beeinflusst, indem das Gebiet des Kagera fruchtbar
und reicher an Niederschlägen ist als das Tanganyika-Gebiet,
während das Urigi-Gebiet etwa die Mitte zwischen beiden einhält. —
Der Grund liegt wohl hauptsächlich in der verschiedenen Seehöhe,
möglicherweise auch in herrschenden Windrichtungen, deren
Erforschung der Zukunft vorbehalten bleibt.
An das Klima ist die Vegetation gebunden, welche den
L a n d sch a ft sch a r a kt e r bestimmt. Durch einen Steppenstreifen ist
das Nyansa-Ufer von Ussui getrennt, ein vorherrschend offenes,
grasiges Gebiet in dem nur Siedelhaine und vereinzelt hohe
Laubbäume aufragen. Diese verschwinden im centralen Ussui, das
einen sehr dürren Charakter mit rothem, eisenschüssigem Gerölle
und spärlichem Gestrüpp an den Hängen besitzt. West-Ussui und
Urundi sind fast ganz Weideland, mit Wiesen die alljährlich
abbrennen und deren Eintönigkeit nur durch die dunkelgrünen
Papyrus-Sümpfe und Siedelhaine unterbrochen wird. Erst an den
Hängen der Missosi ya Mwesi tritt Bergwald mit zahlreichen Bambus
auf. Das südliche Urundi, welches schon dem Mlagarassi-Gebiet
angehört, ist ziemlich trocken und steinig. Uha ist ein Waldland; auf
ungeheuren Strecken bedeckt mit wasserarmen, lichten
Laubwäldern, in welchen Caesalpiniaceen vorherrschen und welche
als Miombowälder in das östliche Unyamwesi übergreifen. Die
einzige Unterbrechung dieser Wälder bilden in Uha ausgedehnte,
zur Regenzeit versumpfte Savannen. Da das ganze Gebiet mehr
oder weniger dicht besiedelt ist, so ist Wild ziemlich spärlich und
findet sich nur in den Wildnissen von Uha. —
Wenn wir das ganze Gebiet überblicken, so finden wir in
demselben eine uralte Kontinentalmasse, in welcher Sedimente nur
eine untergeordnete Rolle spielen und die durch das Vorherrschen
primärer Gesteine ausgezeichnet ist. Die gebirgsbildenden Motoren,
die in Europa und Asien durch Faltung das Antlitz der Erde
veränderten, übten hier keine wahrnehmbare Wirkung. An ihre Stelle
traten grossartige Störungslinien, welche das Land, in geologisch
jüngster Zeit, in einzelne Schollen zerrissen und es zu einem der
merkwürdigsten und bedeutungsvollsten Gebiete der Erdoberfläche
machten.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com