mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-23 09:09:18 +02:00
some inbetween progress
This commit is contained in:
parent
d9b1d806ee
commit
761cd7d1d7
4 changed files with 9518 additions and 0 deletions
9416
package-lock.json
generated
Normal file
9416
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
35
package.json
Normal file
35
package.json
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"name": "jonas_jones-api",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "an api used for my website",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"start": "nodemon server.js --exec babel-node --presets babel-preset-env",
|
||||||
|
"lint": "eslint src/js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/j-onasJones/jonas_jones-api.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"RESTful",
|
||||||
|
"API",
|
||||||
|
"node",
|
||||||
|
"mongoDB"
|
||||||
|
],
|
||||||
|
"author": "Jonas_Jones",
|
||||||
|
"license": "ISC",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/j-onasJones/jonas_jones-api/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/j-onasJones/jonas_jones-api#readme",
|
||||||
|
"dependencies": {
|
||||||
|
"babel-cli": "^6.26.0",
|
||||||
|
"babel-core": "^6.26.3",
|
||||||
|
"babel-loader": "^9.1.2",
|
||||||
|
"babel-preset-env": "^1.7.0",
|
||||||
|
"body-parser": "^1.20.1",
|
||||||
|
"express": "^4.18.2"
|
||||||
|
}
|
||||||
|
}
|
41
projects.js
Normal file
41
projects.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
{
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
id: -1,
|
||||||
|
title: 'Template Project',
|
||||||
|
description_short: 'This is a template project.',
|
||||||
|
description: 'This is a template project. It\'s goals are to provide a template for future projects.',
|
||||||
|
technologies: ['A list of technologies used, not languages'],
|
||||||
|
languages: ['A list of languages used, not technologies'],
|
||||||
|
versions: ['A list of versions if not on github or modrinth'],
|
||||||
|
latest_release: 'The latest release if not on github or modrinth',
|
||||||
|
topics: ['A list of topics if not on github'],
|
||||||
|
platforms: ['A list of platforms if not on github', 'github', 'modrinth', 'curseforge', 'website'],
|
||||||
|
os: ['A list of operating systems if not on github', 'windows', 'linux', 'macos', 'android', 'ios'],
|
||||||
|
bg_image: 'https://link.to.image',
|
||||||
|
icon_image: 'https://link.to.image',
|
||||||
|
github: 'https://link.to.github/repo',
|
||||||
|
home: 'https://link.to.home.page',
|
||||||
|
status: 'Release',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
title: 'Website V1',
|
||||||
|
description_short: 'My first attempt at a website.',
|
||||||
|
description: 'My first attempt at a website. It\'s goals were to list the projects I\'ve worked on and provide a way to contact me.',
|
||||||
|
technologies: ['HTML', 'CSS', 'JavaScript'],
|
||||||
|
image: 'https://via.placeholder.com/150',
|
||||||
|
github: 'https://github.com/J-onasJones/J-onasJones.github.io/',
|
||||||
|
live: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
title: 'Project Two',
|
||||||
|
description: 'This is the second project',
|
||||||
|
technologies: ['HTML', 'CSS', 'JavaScript'],
|
||||||
|
image: 'https://via.placeholder.com/150',
|
||||||
|
github: '',
|
||||||
|
live: '',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
server.js
Normal file
26
server.js
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
const express = require('express')
|
||||||
|
const app = express();
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.send('Welcome to the jonas_jones-api!')
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get('/projects', (req, res) => {
|
||||||
|
const keyword = req.query.keyword;
|
||||||
|
const version = req.query.version;
|
||||||
|
const platform = req.query.platform;
|
||||||
|
const topic = req.query.topic;
|
||||||
|
return res.status(200).json({
|
||||||
|
success: true,
|
||||||
|
projects: {
|
||||||
|
keyword: keyword,
|
||||||
|
version: version,
|
||||||
|
platform: platform,
|
||||||
|
topic: topic,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
app.listen(8000, () => {
|
||||||
|
console.log('api listening on port 8000!')
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue