Deno web development write, test, maintain, and deploy JavaScript and TypeScript web applications using Deno
Deno Web Development is the definitive guide to starting to write, test, and deploy reliable Deno applications. You'll be able to apply Deno to common use cases from simple command-line interface (CLI) utilities to multi-featured APIs. By the end of this Deno book, you'll be comfortable wi...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England ; Mumbai :
Packt
[2021]
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009631754106719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Dedication
- Foreword
- Contributors
- Table of Contents
- Preface
- Section 1: Getting Familiar with Deno
- Chapter 1: What is 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
- 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
- Chapter 2: The Toolchain
- 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
- Chapter 3: The Runtime and Standard Library
- 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
- Chapter 4: Building a Web 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
- Chapter 5: Adding Users and Migrating to Oak
- 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
- Chapter 6: Adding Authentication and Connecting to the Database
- 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.
- Chapter 7: HTTPS, Extracting Configuration, and Deno in the Browser
- 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
- Chapter 8: Testing - Unit and Integration
- 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
- Chapter 9: Deploying a Deno Application
- 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
- Chapter 10: What's Next?
- 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
- Why subscribe?
- About Packt
- Other Books You May Enjoy
- Index.