-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
28 lines (23 loc) · 914 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const express = require('express')
const app = express()
const path = require('path')
let ejs = require('ejs')
app.set('view engine', 'ejs')
app.use('/static', express.static(path.join(__dirname, 'public')))
app.get("/", (request, response) => {
response.render('index')
})
app.get("/search", (request, response) => {
let mainCategories = request.params.cats || []
let mainCategoriesExcluded = request.params.noCats || []
let tags = request.params.tags || []
let tagsExcluded = request.params.noTags || []
let searchForName = request.params.name || 0
let searchForDescription = request.params.description || 0
let searchForAuthor = request.params.author || 0
console.log({mainCategories, mainCategoriesExcluded, tags, tagsExcluded, searchForName, searchForDescription, searchForAuthor})
response.send('asd')
})
app.listen(9090, () => {
console.log("Started")
})