MP4 | Video: h264, 1280×720 | Audio: AAC, 44.1 KHz, 2 Ch
Genre: eLearning | Language: English| Duration: 25 lectures (3h 6m) | Size: 1.89 GB
Build modern ColdFusion apps with Coldbox (Coldbox 6.5 , Lucee 5.3, MySQL 5.7)
What you’ll learn
Use the Coldbox framework to build a REST API
Create a database schema with Coldbox migration (cfmigrations) components
Write model components classes and test them with the Testbox BDD module
Write API handlers and test them with the Testbox BDD module
Document the API by adding annotations to each of our handler’s actions
Generate our API documentation with the Coldbox cbSwagger module
Create an OpenAPI yaml file with the Open API Editor (f.k.a the Swagger editor)
Import the generated OpenAPI yaml file in POSTMAN
Test the API with data input within POSTMAN
Export the API from POSTMAN as a collection file
Requirements
This course will be run on a Mac and all instructions will apply to a Mac environment
Must have a MySQL 5.7 database installed and a client utility to connect to it
No prior knowledge or experience with Coldbox or CFML coding are needed
Description
We are going to build a Coldbox REST API and test it using the TestBox module. We shall document this API by adding annotations to our API handlers. We’ll then use the Coldbox cbSwagger module to generate our API documentation in the Swagger Editor. Finally, we’ll use Postman to input data in order to simulate API responses from calls to our development server.
Please note however, that it is not in the scope of this course to explain Swagger Editor and Postman tools in detail. Also note that API security issues using Coldbox cbSecurity and JWT (Json Web Tokens) won’t be discussed in this course. Last and not least, we won’t build and connect a javaScript front-end to this server-side API.
We are first going to add tables to our MySQL database schema called Merapi (4 tables altogether) , build relationships between those tables and populate our tables with seed data with the help of Coldbox cfmigrations module. This database schema manages data about Countries, Currencies, Cities and Airports. The cfmigrations module was already covered in detail in my two earlier tutorials, but will be covered again at the beginning of this tutorial and documented in the guide provided with it.
Next, we are going to build our model and map our entity class property names to our tables columns name using an XML schema file representing the database schema. We’ll also have an XML Loader file to read the XML schema, thus implementing a simple custom object relational mapper. This approach is an alternative, to what we demonstrated in another course called Tamarind v1, in which we used Quick ORM to map entity object properties to table columns and to load entities in memory. Therefore, in this course, no ORM is involved.
We also leveraged object inheritance with the creation of a BaseService parent component. Like a DAO (Data Access Object), this component provides an abstraction of our queries for READ, DELETE and record filtering methods. This way, there is no need to write those queries again in the children components. We simply call the relevant method from the BaseService parent component with the Super keyword.
To make sure that our model entity and services are fully functional, we shall use the Testbox module to write unit tests. After completing our model entity and service components and making sure all our unit tests pass, we shall focus on building the API itself. The API is going to deal with two types of things: the API handlers and the API documentation.
The handlers are composed of actions (index, show, create, update and delete). As we write our handlers, we shall also write the corresponding integration tests that guarantee that our handlers are working fine. Integration tests will also be written with Testbox.
The API documentation is composed of json files such as responses, requestBody, parameters and examples that apply to each handler’s action based on an API response such as 2xx (Success), 4xx (Not found or validation error) or 5xx (Server error). A pointer to each of these json files found in the /apidocs folder, will be added as an annotation to the handler’s action code. Thanks to this, our API documentation will become immediately exportable to tools such as Postman or OpenAPI (Swagger).
Once this is done, we shall leverage the Coldbox cbswagger module to generate an output as we hit our development server url at cbswagger. Copying and pasting this cbwagger output in our Swagger Editor will not only deliver a colourful and neat documentation of our API, but also generate an openAPI.yaml file that we can then import into Postman. Postman is a tool that allows further testing of our API server with real data.
At the end of the course, you should have acquired a solid and practical understanding as how to build a server-side REST API with the Coldbox framework.
Who this course is for
Software developers, consultants and corporate power users
Developers and maintainers of legacy ColdFusion code
Developers recognising the value of open source technology adoption
Developers that are open to learn and explore an alternative server side technology
Password/解压密码www.tbtos.com
https://rg.to/file/7b0585a578126213b1b1c6aff907bccb/Build_a_server-side_RESTful_API_with_Coldbox_(Merapi).part1.rar.html
https://rg.to/file/a37404c84e16789db5aa8b4be7a740b5/Build_a_server-side_RESTful_API_with_Coldbox_(Merapi).part2.rar.html
https://rg.to/file/6727e2cdc2318035833a13a07f747057/Build_a_server-side_RESTful_API_with_Coldbox_(Merapi).part3.rar.html
转载请注明:0daytown » Build a server-side RESTful API with Coldbox (Merapi)