Code Monkey home page Code Monkey logo

htmx-crash-course's Introduction

HTMX Crash Course from Traversy Media

Quick Start

In your project folder:

  • npm init -y
  • npm i express
  • npm install axios
  • npm i -D nodemon
  • Inside package.json:
{
  "name": "htmx-crash-course",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",                     <- ADDED THIS
  "scripts": {
    "dev": "nodemon server.js"          <- CHANGED THIS
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^1.6.5",
    "express": "^4.18.2"
  },
  "devDependencies": {
    "nodemon": "^3.0.2"
  }
}
  • touch server.js
  • Inside server.js:
import express from "express";
import axios from "axios";

const app = express();

// Set static folder
app.use(express.static("public"));
// Parse URL-encoded bodies (as sent by HTML forms) - this is what allows you to get fahrenhiet. This is your middleware
app.use(express.urlencoded({ extended: true }));
// Parse JSON bodies (as sent by API clients)
app.use(express.json());

<!-- ALL YOUR SERVER STUFF WILL GO HERE -->

// Start the server
app.listen(3000, () => {
  console.log("Server listening on port 3000");
});

  • npm run dev
  • mkdir public <- All your files that you'll use will go in here
  • put index.html inside public folder
  • Download and put htmx.min.js in your public folder
  • Put <script src="/path/to/htmx.min.js"></script> in your <head> in index.html

htmx-crash-course's People

Contributors

vebriclya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.