proof of concept

This commit is contained in:
Jonas_Jones 2023-12-03 18:23:36 +01:00
parent aea93a5527
commit 6abba646c7
14 changed files with 1099 additions and 69098 deletions

View file

@ -1,26 +0,0 @@
import express from '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!')
});

18
src/main.rs Normal file
View file

@ -0,0 +1,18 @@
use warp::Filter;
#[tokio::main(flavor = "current_thread")]
async fn main() {
// GET /hello/warp => 200 OK with body "Hello, warp!"
let hello = warp::path!("hello" / String)
.map(|name| format!("Hello, {}!", name));
let root = warp::path::end()
.map(|| "Hello, World!");
let routes = hello.or(root);
warp::serve(routes)
.run(([127, 0, 0, 1], 3030))
.await;
}

View file

@ -1,41 +0,0 @@
{
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: '',
}
]
}