INFO 2480-61: Website Database Implementation
  • Syllabus
  • Welcome Letter
  • Week 1: Software and Setup
    • Folder Structure
    • Git: Getting Started
      • Installing a Git Client
      • Creating a Local Repository
      • Making Changes and Merging them
      • Git Wrap Up
    • Git: Github
      • Creating a New Account
      • Creating a Repo on Github
      • Cloning and Forking
      • Cloning a Repo from Github
      • Pushing Changes to Github.com
      • Github: Adding a Collaborator
    • Command Box
      • Downloading the Software
      • Unzipping and Running the Software for the first time
      • Using CommandBox And Installing the UML-Info package.
      • Setting Up Your Local Server
      • Last Step
    • IDE ( Integrated Development Environment )
      • VS Code
      • IntelliJ
    • Journal
  • Week 2: Review of HTML and CSS
    • Making Point In Time and Working Branches
    • Opening our Project from Week 1 and Starting our BoxLang server
    • HTTP Calls and Requests
    • Making a Static Website Dynamic
    • Creating The Management Index.bxm
    • Creating An HTML Form with Bootstrap
    • Last Steps
  • Week 3: Working Forms and our First Table
    • Data Types
    • Case Types and Naming Conventions
    • Database Tools and Your First DB
      • Installing MySql WorkBench
      • Connecting to your MySQL database
      • Creating Your First Table
    • Working Forms
      • Separation of Concerns
      • Configuring Our Site To Use Our Database
      • Capturing Your Form Data
      • Creating Our Server Side Logic
  • Week 5: SQL and Modelling
    • Our Project And Its Users
    • Introduction to SQL
    • Completing our Articles page.
      • Adapting manageArticles.bxm to display existing articles in the database
      • Completing ManageArticles.bxm to Edit Existing Articles.
      • Making Active Articles Appear On The Public Page
  • Week 6: Managing Books
    • Introduction To Modelling
    • Our Data Models
    • Adapting Our Management Page To Be Multi-Tool
    • Creating The Manage Books Page
    • Adding Search To Our Front Index Page
  • Week 7: Working with Selects, Files, WYSIWYG and more.
    • Adding WYSIWYG Capabilities
    • Adding WYSIWYG to the Manage Books Tool
    • Adding Images To Our Store
    • Creating Our Publisher Select Control
  • Week 9: Joins and Better Searching
    • Displaying Our Publisher
    • Searching By Publisher
    • Creating a Browse by Genre
      • Adapting Our Database
      • Building our Queries: Part 1
      • Assigning Genres to a Book in our AddEdit.bxm page
      • Building our Queries: Part 2
      • Building the GenreNav.bxm
      • Adapting The Details.bxm Page to Search By Genre
  • End of Project Checkllist
Powered by GitBook
On this page
  1. Week 3: Working Forms and our First Table
  2. Working Forms

Configuring Our Site To Use Our Database

PreviousSeparation of ConcernsNextCapturing Your Form Data

Last updated 3 months ago

Just like we configured MySQL Workbench to connect to our database, we need to configure our BoxLang server to connect to it as well.

  1. Open your ongoingWork folder in VSCode.

  2. In the file menu on the left side, find the file called .cfconfig.json. This is a special configuration file that CommandBox feeds into our BoxLang server when it starts up. In it we can define datasources, mapped drives and a number of other settings.

  3. Notice how in the .cfconfig.json file, there is a section called datasources

  4. Replace where it says **DSOURCENAME** with your username ( first_last ).

  5. Notice the other values which are in a format like ${}? These are for server names, usernames and passwords BUT you don't want to check those values into a git repo because you don't want them shared. So what does that format mean? Those values are being pulled from another file called .env which does not get checked into the git repo.

  6. Open up the .env file.

  7. Put the appropriate values into the .env file and save it. Something like this but with your values:

  8. The last step is to open the file Application.bx and add the line this.datasource = 'Username' where Username is the username I sent your, not the actual word username.

  9. In CommandBox, in your ongoingWork folder, restart your server by typing server restart.