Skip to content

Instantly share code, notes, and snippets.

View afixoftrix's full-sized avatar
🎯
Focusing

Yoowana afixoftrix

🎯
Focusing
  • Sol Constellation
View GitHub Profile
@afixoftrix
afixoftrix / index.js
Created July 8, 2019 11:59
a solution
// full solution: https://github.com/afixoftrix/odin_basic_info_site
const http = require('http');
const fs = require('fs');
const path = require('path')
const server = http.createServer((req, res) => {
if (req.url === '/'){
const filepath = path.join( process.cwd(), "/public/index.html" )
console.log(filepath);
fs.readFile(filepath, (err, html) => {