SitePoint
  • Premium
  • Library
  • Community
  • Jobs
  • Blog
LoginStart Free Trial
Deno Web Development
Deno Web Development
Deno Web Development
Foreword
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Section 1: Getting Familiar with Deno
A little history
Handling I/O
Node.js enters the scene
Why Deno?
Presenting Deno
A web browser for command-line scripts
Architecture and technologies that support Deno
Inspiration from POSIX systems
Architecture
Grasping Deno's limitations
Not as stable as Node.js
Better HTTP latency but worse throughput
Compatibility with Node.js
TypeScript compiler speed
Lack of plugins/extensions
Exploring use cases
A flexible scripting language
Safer desktop applications
A quick and complete environment to write tools
Running on embedded devices
Generating browser-compatible code
Full-fledged APIs
Summary
Technical requirements
Setting up the environment
Installing Deno
Installing VS Code
Shell completions
Hello World
Debugging code in Deno
Modules and third-party dependencies
Locally cached dependencies
Managing dependencies
Import maps
Inspecting modules
Exploring the documentation
Running and installing scripts
Installing utility scripts
Permissions
Using the test command
Filtering tests
Fail fast
Formatting and linting
Formatting
Lint
Bundling code
Compiling to a binary
Using the upgrade command
Summary
Technical requirements
The Deno runtime
Stability
Program lifecycle
Web APIs
Exploring the Deno namespace
Building a simple ls command
Using dynamic permissions
Using the filesystem APIs
Using buffers
Reading and writing from Deno.Buffer
Using the standard library
Adding colors to our simple ls
Building a web server using the HTTP module
Summary
Section 2: Building an Application
Technical requirements
Structuring a web application
Deno as an unopinionated tool
The most important part of an application
What is our application about?
Understanding folder structure and application architecture
Developing the business logic
Developing the data accessing logic
Creating the web server
Wiring the web server to the business logic
Exploring Deno HTTP frameworks
What alternatives exist?
The verdict
Summary
Technical requirements
Managing dependencies and lock files
Using a centralized dependency file
Creating a lock file
Writing a web server with Oak
Adding event listeners to an Oak application
Handling routes in an Oak application
Connecting the router to the application
Adding users to the application
Creating the user module
Storing a user in the database
Creating the user repository
Creating the register endpoint
Wiring the user controller with the web layer
Summary
Technical requirements
Using middleware functions
How does middleware work?
Adding request timing via middleware
Adding request logging via middleware
Adding authentication
Creating the login business logic
Creating the login endpoint
Adding authorization with JWT
Returning a token from login
Making an authenticated route
Connecting to MongoDB
Creating a User MongoDB repository
Installing the MongoDB client library
Developing the MongoDB repository
Connecting the application to MongoDB
Connecting to a MongoDB cluster
Summary
Technical requirements
Enabling CORS and HTTPS
Enabling CORS
Enabling HTTPS
Extracting configuration and secrets
Creating a configuration file
Accessing secret values
Running Deno code in the browser
Summary
Section 3: Testing and Deploying
Technical requirements
Writing your first test in Deno
Defining a test
A unit test for MuseumController
Writing an integration test
Testing the web server
Creating integration tests for the application
Testing the application together with the API client
Benchmarking parts of the application
Summary
Technical requirements
Preparing the environment for the application
Creating a Dockerfile for the Deno application
Running a Terminal inside a container
Building and running the application in Heroku
Creating the application in Heroku
Building and running the Docker image
Configuring the application for deployment
Getting the application port from the environment
Summary
Looking back at our journey
Deno's roadmap
Deno's future and community
Interesting things happening in the community
Publishing a package to Deno's official registry
Summary
Leave a review - let other readers know what you think

Community Questions