A simple, naïve, in-memory RESTful guest list API in Express.
git clone https://github.com/upleveled/express-guest-list-api-memory-data-store.git
cd express-guest-list-api-memory-data-store
pnpm install
pnpm startconst baseUrl = 'http://localhost:4000';const response = await fetch(`${baseUrl}/guests`);
const allGuests = await response.json();const response = await fetch(`${baseUrl}/guests/:id`);
const guest = await response.json();const response = await fetch(`${baseUrl}/guests`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ firstName: 'Karl', lastName: 'Horky' }),
});
const createdGuest = await response.json();const response = await fetch(`${baseUrl}/guests/1`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ attending: true }),
});
const updatedGuest = await response.json();const response = await fetch(`${baseUrl}/guests/1`, { method: 'DELETE' });
const deletedGuest = await response.json();- Click "Fork" at the top right of the
express-guest-list-api-memory-data-storeGitHub repository page, select your GitHub account and click "Fork" to create a copy of the GitHub repository in your account - On Deno Deploy - New App, click on "Sign in with GitHub", authorize Deno Deploy to access your GitHub account and accept the terms and conditions
- If your account doesn't appear in the "Select user or organization" dropdown, select "Add another GitHub Account", and then on the install page on GitHub, select your GitHub account, choose "Only select repositories", select the repository
express-guest-list-api-memory-data-storefrom the dropdown and click the green "Install" button - Select your GitHub account in the dropdown and select the forked repository
express-guest-list-api-memory-data-store - Scroll to the bottom of the page and click "Create App"
- After all stages of the build are marked with green checkmarks, click "Overview" on the left to continue to the project overview page
The API URL is on the top right of the project overview page under "Production URL".