diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md index cf7f493..6348a69 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,16 @@ -# ariketa-03 +# Ariketa-03 +03.-Oinarrizko web aplikazio bat eraiki Node.js, Express.js eta Pug erabiliz - Pug -03.-Oinarrizko web aplikazio bat eraiki Node.js, Express.js eta Pug erabiliz - Pug \ No newline at end of file +https://apunteak.lainoa.eus/post60427300b75d960d00823bb7 + +## Instalakuntza + git clone https://git.lainoa.eus/aitzol/ariketa-03.git + cd ariketa-03 + npm install + +## Test + node index.js +localhost:8080 + +## Demo +[demoa](https://lainoa.eus/demoak/ariketa-03) diff --git a/index.js b/index.js new file mode 100644 index 0000000..7b2e548 --- /dev/null +++ b/index.js @@ -0,0 +1,29 @@ +const express = require('express'); +const app = express(); +const path = require('path'); + +app.set('port', 8080); +app.use(express.static(path.join(__dirname, 'public'))); +app.use('/images', express.static(path.join(__dirname, 'public/images'))); + +app.get('/', (req, res) => { + res.status(200).sendFile(__dirname + '/index.html'); +}); + +app.get('/irudiak', (req, res) => { + res.status(200).sendFile(__dirname + '/irudiak.html'); +}); + +app.get('/irudi_:num', (req, res) =>{ + var num = req.params.num; + res.status(200).sendFile(__dirname + '/irudi_'+num+'.html'); +}); + +app.get('*', (req, res, next) => { + res.status(200).send('Eskatu duzun orrialdea ez da aurkitu!'); + next(); +}); + +app.listen(app.get('port'), () => { + console.log('Zerbitzaria martxan ' + app.get('port') + ' atakan'); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..71b52f9 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "ariketa-03", + "version": "1.0.2", + "description": "03.-Oinarrizko web aplikazio bat eraiki Node.js, Express.js eta Pug erabiliz - Pug", + "main": "index.js", + "dependencies": { + "express": "^4.17.1" + }, + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node index.js" + }, + "author": "superuser@lainoa.eus", + "license": "GPL-3.0-or-later" +} + diff --git a/public/css/styles.css b/public/css/styles.css new file mode 100644 index 0000000..a3c482f --- /dev/null +++ b/public/css/styles.css @@ -0,0 +1,43 @@ +.edukiontzia { + display: table; + margin:auto; +} + +.item1 { grid-area: irudi1; } +.item2 { grid-area: irudi2; } +.item3 { grid-area: irudi3; } + +.irudi_1, .irudi_2, .irudi_3 { + width: 180px; +} + +.irudiak{ + display: grid; + grid-template-areas: + 'irudi1 irudi2 irudi3'; + grid-gap: 10px; + padding: 10px; + width: max-content; +} + + +@media only screen and (max-width: 360px) { + .irudiak{ + grid-template-areas: + 'irudi1' + 'irudi2' + 'irudi3'; + } +} +@media only screen and (max-width: 640px) { + .irudi{ + width: 200px; + } +} + +a { + text-decoration: none; +} +a:visited { + color: blue; +} \ No newline at end of file diff --git a/public/images/irudi_1.jpg b/public/images/irudi_1.jpg new file mode 100644 index 0000000..9bbce22 Binary files /dev/null and b/public/images/irudi_1.jpg differ diff --git a/public/images/irudi_2.jpg b/public/images/irudi_2.jpg new file mode 100644 index 0000000..609fd17 Binary files /dev/null and b/public/images/irudi_2.jpg differ diff --git a/public/images/irudi_3.jpg b/public/images/irudi_3.jpg new file mode 100644 index 0000000..e4f88c8 Binary files /dev/null and b/public/images/irudi_3.jpg differ