This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; // import express framework | |
import bodyParser from "body-parser"; // import body-parser for form parsing | |
import supabase from './db.js'; // import supabase client from local file | |
const app = express(); // create express app instance | |
const port = 3000; // define server port | |
app.use(bodyParser.urlencoded({ extended: true })); // parse urlencoded form data | |
app.use(express.static("public")); // serve static files from public directory | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; // import express framework | |
import axios from "axios"; // import axios for http requests | |
import bodyParser from "body-parser"; // import body-parser for parsing form data | |
const app = express(); // create express app instance | |
const port = 3000; // define port number | |
app.use(bodyParser.urlencoded({ extended: true })); // parse urlencoded form data | |
app.set("view engine", "ejs"); // set ejs as the template engine | |
app.use(express.static("public")); // serve static files from public folder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; // import express framework to create server | |
import axios from "axios"; // axios for making http requests to external APIs | |
import bodyParser from "body-parser"; // body-parser to parse form submissions | |
import path from "path"; // path module for working with file and directory paths | |
import { fileURLToPath } from "url"; // utility to get filename from module url | |
const __filename = fileURLToPath(import.meta.url); // current file path | |
const __dirname = path.dirname(__filename); // directory name of current file | |
const app = express(); // create express app instance |