- Node.js used with Koa instead of Express middleware, with embedded javascript (EJS) & Bootstrap to display oil well data
- Note: to open web links in a new window use: ctrl+click on link
- Koa middleware used to add routing, body-parser, JSON and EJS HTML views
- Simple Bootstrap navbar
- An oil well name can be added to the list - this is not stored in a database and will be lost when app is shut down.
- Node.js v16 Javascript runtime using the Chrome V8 engine
- koa v2 HTTP middleware alternative to Express.js
- koa-ejs v4 embedded Javascript
- Bootstrap v5 responsive navbar and styling
npm i
to install dependenciesnpm run dev
runs app in the development mode with auto-restart.- Open http://localhost:5000 to view in the browser.
- N/A
index.js
asynchronous function to render the index page in the browser root using Koa middleware
router.get("/", async (ctx) => {
await ctx.render("index", {
title: "Underground Injection Control Wells",
wells: wells,
});
});
- Uses Koa which is much lighter than the usual Express middleware
- Status: Working
- To-Do: Add well update and delete + database connection & other db fields such as location of well etc.
- Oklahoma Oil Well Data
- esparkinfo.com/blog: Express vs Koa: Which Node.js Framework Is Best For You?
- This project is licensed under the terms of the MIT license.
- Repo created by ABateman, email: gomezbateman@yahoo.com