“Mengekspresikan file statis JS” Kode Jawaban

File statis server Node Express

var express = require('express');
var app = express();
var path = require('path');

//app.use(express.static(__dirname)); // Current directory is root
app.use(express.static(path.join(__dirname, 'public'))); //  "public" off of current is root

app.listen(80);
console.log('Listening on port 80');
JDog

Cara Mengirim File Statis di Express

app.use('/', express.static(__dirname));
rohit sekh

Folder Statis Express

// dependencies
const path = require('path');

// set static folder
app.set(express.static(path.join(__dirname, 'public')));
Mehedi Islam Ripon

Mengekspresikan file statis JS

app.use(express.static('public'))
Tired Termite

App.Use Public

app.use(express.static('public'))
app.use(express.static('files'))
Testy Tamarin

Jawaban yang mirip dengan “Mengekspresikan file statis JS”

Pertanyaan yang mirip dengan “Mengekspresikan file statis JS”

Lebih banyak jawaban terkait untuk “Mengekspresikan file statis JS” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya