Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit f5e17e7e authored by Martin Déclert's avatar Martin Déclert
Browse files

Initial commit

parent 74ec4b7b
No related branches found
No related tags found
No related merge requests found
Pipeline #63 canceled
node_modules/
\ No newline at end of file
......@@ -3,8 +3,8 @@ FROM ubuntu:20.04
ARG user=martin
ARG uid=1000
EXPOSE 80/tcp
EXPOSE 80/udp
EXPOSE 8000/tcp
EXPOSE 8000/udp
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf \
&& echo "nameserver 8.8.4.4" >> /etc/resolv.conf
......
This diff is collapsed.
{
"name": "website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon server.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/MartDec/MartDec.github.io.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/MartDec/MartDec.github.io/issues"
},
"homepage": "https://github.com/MartDec/MartDec.github.io#readme",
"dependencies": {
"express": "^4.17.1",
"nodemon": "^2.0.4",
"path": "^0.12.7"
}
}
class Router {
constructor (express) {
this.router = express.Router()
}
home () {
this.router.get('/', async (req, res) => {
return res.sendFile('views/index.html')
})
}
listen () {
this.home()
return this.router
}
}
module.exports = Router
\ No newline at end of file
const express = require('express')
const path = require('path')
const PORT = 8000
const Router = require('./router')
class Server {
constructor () {
this.server = express()
this.router = new Router(express)
}
init () {
this.server.set('views', __dirname + '/www')
this.server.use(express.static(path.join(__dirname, 'www')))
this.server.use('/', this.router.listen())
this.server.listen(PORT, () => {
console.log(`listening on port ${PORT}`)
})
}
}
const server = new Server
server.init()
\ No newline at end of file
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment