teleren/devto huggingface dataset:
Create Api Endpoint in Next.js
Published: 2024-06-14 18:20:57

I recently learned I could create an api endpoint in nextjs without having to use node/express. I'll share my little knowledge on what I've learned and how you can start creating api endpoints in nextjs.

First you need to initialise a next app

![nextjs setup command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mvagvmbkjw6iau7fb5y.png)

![nextjs setup options](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91pnccpy3e4pxyyo79vp.png)

Once the new project is created, you should have something like this when you open up your project👇🏻

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4xageagoj2hpfznxns3.png)

Now, it's time to create some folders (nextjs uses folders for routing). Create 2 folders inside the `app` folder with a new file called `hello.js`. It should look something like this👇🏻

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/krah9yl87mdw7tyxl395.png)

It's time to throw the boring stuff in the trash

![trash throw gif] (https://media.giphy.com/media/NHs9GJQzKh3uU/giphy.gif?cid=790b7611kcnx6h3ferjyhhsnuqd2iuwdvv2myqdssrjldirz&ep=v1_gifs_search&rid=giphy.gif&ct=g)

Let's create our first endpoint, which is going to be a GET request. First, we need to import some things from `next/server`👇🏻

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/41x0m2fnpnlih7k7wtnq.png)

This 2 imports we've made are basically telling nextjs that we want to be able to send a response and make a request, similarly to the request and response argument in nodejs.

Now, let's create a simple function for our GET request. Here's how you do it👇🏻

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cf57vjnsfaxysefo8vpx.png)

To test if this works, start your project by typing `npm run dev` in the terminal. Now, head over to postman or use an extension in vscode called Thunderclient, and then add this url `http://localhost:3000/api/endpoints`.

You should have something like this👇🏻

![nextjs get request thunderclient](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/it26i8zx1tgxd7zze50g.png)

Great! Now we've successfully created a GET request, now what? Well, now it's time to learn how to create a POST request to be able to get information from users on the frontend.

To do this, we basically repeat the same thing but with some little tweaks as shown below👇🏻

![nextjs get request thunderclient](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70bpy5wo2r5x0zqgjcam.png)

Now, let's try making a POST request in postman/Thunderclient. The result should be something like this👇🏻

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/39d7bwyyb0e8qu97rdc8.png)

Awesome work! You now know the basics of creating endpoints in nextjs

![clapping gif](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExczk4YzJseHdtbW5heTA5aWppb2MxYnd2emk5YzZ5ZTY1ZjBpanQ0eCZlcD12MV9naWZzX3NlYXJjaCZjdD1n/l3q2XhfQ8oCkm1Ts4/giphy.gif)
Creative Full Screen Showcase Slider
Tags: codepen
Published: 2024-06-14 18:12:24

This CodePen demo features a stunning full-screen showcase slider built using Swiper.js. It highlights various creative projects with immersive background images and parallax effects. Each slide includes dynamic headings and subtitles, and there are smooth transitions between slides.

Features:

Full-screen slides with beautiful background images
Parallax scrolling for a dynamic visual experience
Responsive design for optimal viewing on all devices
Navigation controls and pagination for easy browsing
Autoplay functionality to cycle through the slides automatically
Perfect for showcasing portfolios, products, or any visual content in a captivating way.

{% codepen https://codepen.io/CreativeSalahu/pen/pompzNW %}
(AUBSS) Receives Full Accreditation From BILIM-STANDARD, The Independent Accreditation Agency Of Kyrgyz Republic
Tags: education, news, qahe, aubss
Published: 2024-06-14 18:11:28


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q95s2eo6dgdzyycifjx3.png)

American University of Business and Social Sciences (AUBSS) is proud to announce that it has achieved full accreditation from The Public Foundation “Independent Accreditation Agency ‘BILIM-STANDARD'” of Kyrgyz Republic. This prestigious accreditation body operates internationally and holds memberships in prominent organizations such as the Asia-Pacific Quality Assurance Network (APQN), the International Network of Quality Assurance Agencies in Higher Education (INQAAHE), and the Eurasian Association for the Assessment of Quality in Education.

 

The accreditation by BILIM-STANDARD is a testament to AUBSS’s commitment to upholding the highest standards of quality in education. It recognizes the university’s dedication to providing exceptional academic programs and services to its students.

 

AUBSS offers a range of programs including the Honorary Doctorate Degree, Mini-MBA, MBA, DBA, and Distinguished Professorship Award. These programs are designed to cater to the diverse needs of professionals seeking career advancement and personal development. Candidates interested in pursuing the Honorary Doctorate Degree, Mini-MBA, MBA, DBA, or the Distinguished Professorship Award are invited to contact AUBSS for further details. They can reach out to the university by emailing admission@aubss.edu.pl or visiting the official website at www.aubss.university.

 

This accreditation milestone solidifies AUBSS’s position as a leading institution in business and social sciences education. The university remains dedicated to providing a transformative learning experience and empowering individuals to excel in their chosen fields.
Rapid profit machine review in 2024
Tags: review
Published: 2024-06-14 17:51:09

The Rapid Profit Machine (RPM) is a program that teaches affiliate marketing with a focus on using solo ads for traffic generation. While it offers some basic training on affiliate marketing, there are red flags to consider, such as the upselling of additional products and the potential for promoting spammy offers.

Here's a summary of what you might find helpful to know about RPM:

* **Pros:** Free to start, offers basic affiliate marketing training
* **Cons:** Upsells, potential for promoting low-quality products, focus on solo ads (which can be expensive and ineffective)

If you're interested in learning affiliate marketing, there are many free and reputable resources available online. You can also consider checking out other affiliate marketing programs that don't rely on solo ads. 

[view full content](https://thedailylifereview.com/review-content-01 )
Optimiza Tu PC para Disfrutar de Juegos de Estrategia
Published: 2024-06-14 17:47:32

El mundo de los videojuegos ha evolucionado a pasos agigantados en los últimos años, llevando a los desarrolladores a crear obras maestras llenas de acción, gráficos impresionantes y mecánicas de juego innovadoras. Sin embargo, para disfrutar al máximo de estos juegos, es crucial contar con un equipo que cumpla con los **requisitos del sistema** necesarios. 

Algunos jugadores cometen el error de no comprobar si su PC puede soportar las demandas de un nuevo juego antes de comprarlo. Esto puede llevar a una experiencia de juego frustrante, caracterizada por bajas velocidades de cuadro, gráficos entrecortados y tiempos de carga eternos. Para evitar esto, siempre es una buena idea verificar si tu máquina está a la altura de las circunstancias antes de instalar cualquier título nuevo. Una de las joyas recientes en el género de los juegos de estrategia es Kingdom Wars 2: Battles. Este juego combina la construcción de bases, la gestión de recursos y combates tácticos, llevándote a un mundo medieval lleno de intriga y batallas épicas. Pero ¿cómo puedes asegurarte de que tu PC puede manejar este título sin problemas?

## Tabla de Requisitos Mínimos y Recomendados
Requisito	Mínimo	Recomendado
Procesador	Intel i5	Intel i7
Memoria	6 GB de RAM	8 GB de RAM
Tarjeta Gráfica	NVIDIA GTX 660	NVIDIA GTX 970
Almacenamiento	10 GB	15 GB

Estas especificaciones básicas pueden darte una idea de lo que necesitas, pero determinar la compatibilidad puede ser más complicado de lo que parece. Afortunadamente, existen herramientas en línea que pueden ayudarte a verificar automáticamente si tu PC cumple con los requisitos para un juego específico. 

Si tienes alguna duda sobre la capacidad de tu equipo, te recomiendo revisar esta guía completa que te ofrece detalles precisos y fáciles de seguir para evaluar si tu PC es lo suficientemente potente para ejecutar Kingdom Wars 2: Battles. Recuerda, no hay nada más decepcionante que estar emocionado por un nuevo juego solo para descubrir que tu equipo no puede manejarlo. Haz tu investigación, mejora tu equipo si es necesario y sumérgete en el emocionante mundo de los juegos de estrategia.
What exactly is middleware?
Tags: devchallenge, cschallenge, computerscience, beginners
Published: 2024-06-14 17:45:51


Middleware is software that acts as an intermediary between different components of a system. It facilitates communication, data processing, and coordination between applications, databases, and other software elements. Middleware provides a consistent interface, abstracts away complexity, and enables different parts of a system to work together seamlessly.
What are props in ReactJs?
Published: 2024-06-14 17:36:08

In React.js, props (short for properties) are the way to pass data from a parent component to a child component. This allows for a unidirectional data flow, where the data flows from the parent to the child, and not the other way around.

Suppose we have a parent component named Dad and a child component named MySelf. Inside the MySelf component, we have another child component called SpecialPerson. The goal is for the Dad component to send a gift to the SpecialPerson component. 

**Dad Component:** 
The Dad component wants to send a gift to the SpecialPerson component. To do this, it will pass a prop called gift to the MySelf component.
`<MySelf gift="Gold Ring" />`

**MySelf Component:** 
The MySelf component receives the gift prop as an object in its function parameter.
`const MySelf = ({ gift }) => {
  // Now, the `MySelf` component can access the `gift` prop
  return (
    <div>
      <p>I received a {gift} from my dad!</p>
      <SpecialPerson gift={gift} />
    </div>
  );
};

**SpecialPerson Component:** 
The MySelf component then passes the gift prop to the SpecialPerson component.

`const SpecialPerson = ({ gift }) => {
  // The `SpecialPerson` component can now access the `gift` prop
  return (
    <div>
      <p>Wow, I received a {gift} from my dad through my myself!</p>
    </div>
  );
};
`
Top 10 Most Famous and Efficient AI Tools Available in the Market
Tags: webdev, ai, machinelearning, programming
Published: 2024-06-14 17:30:23

Artificial Intelligence (AI) tools have become indispensable in various industries, from healthcare and finance to marketing and customer service. These tools enhance productivity, provide deep insights, and streamline complex processes. In this article, we will explore the top 10 most famous and efficient AI tools available in the market today, highlighting their features, applications, and benefits.

**1. TensorFlow**
TensorFlow, developed by Google Brain, is an open-source machine learning framework widely used for building and deploying machine learning models. It supports a range of deep learning and neural network algorithms.

**2. PyTorch**
Developed by Facebook’s AI Research lab, PyTorch is another leading open-source machine learning library that is particularly popular for deep learning applications.

**3. IBM Watson**
IBM Watson is a suite of AI tools and services aimed at business applications. It provides a range of AI capabilities through cloud-based APIs.

**4. Microsoft Azure AI**
Microsoft Azure AI provides a suite of AI services and tools for building, training, and deploying machine learning models through Azure’s cloud infrastructure.

**5. Google Cloud AI**
Google Cloud AI offers a wide array of machine learning and AI tools powered by Google’s expertise in AI and cloud computing.


Check out our latest article for a detailed report on the complete list of top AI tools:
https://futuristicgeeks.com/top-10-most-famous-and-efficient-ai-tools-available-in-the-market/

Stay ahead with the latest tech insights by following us and visiting our website for more in-depth articles: **[FuturisticGeeks]**(https://futuristicgeeks.com). Don't miss out on staying updated with the top AI tools and trends!
Unique characters in a string
Tags: interviewquestions, go, programming, career
Published: 2024-06-14 17:27:00

This is the first in a series of coding challenges for golang developers. We'll start easy, so let's get started.

Write a golang function to compute the maximum number of unique characters in a string.

```
package main

import (
    "fmt"
)

func main() {
    str := "Hello, World!"
    maxUnique := maxUniqueCharacters(str)
    fmt.Printf("The string \"%s\" contains %d unique characters.\n", str, maxUnique)
}

func maxUniqueCharacters(str string) int {
    charSet := make(map[rune]bool)

    for _, char := range str {
        charSet[char] = true
    }

    return len(charSet)
}
```

The solution makes use of a `map[rune]bool` to indicate the presence of a given rune. The value in the map acts as a logical or if there are multiple occurrences of a given rune. So once a given rune is found, it is not added to the map again.

Once the string is completely scanned, the length of the map is the number of unique characters in the string.

How can this be improved? Post your thoughts in the comments.

Thanks!

_The code for this post and all posts in this series can be found [here](https://github.com/johnscode/gocodingchallenges)_
Crypto Commerce - Future of E-Commerce?
Published: 2024-06-14 17:26:33

## Problem
Tax and death are the two things in the world you cannot avoid!
I disagree, both of them could be avoidable! At least the first one. consider you can sell goods to people without paying any non-rational tax. 

Also, some countries are controlling people and building walls between different nations. This is unacceptable. You have the right to trade freely and connect with people all over the world whenever you want.

## Solution
Crypto currencies could be our solution. despite the nonrefundable nature of most crypto currencies, they could make humans truly free in terms of trading and payment. Human built a form of currency no government can control.


## Features

1. Selling goods/services with cryptocurrency
2. Managing inventory
3. Online presence of products
4. Connecting to different markets
5. Converting prices to different cryptocurrencies
6. Payer can use a wide range of cryptocurrencies
7. Seller can receive their money quickly in their wallet

## Challenges

1. Seller needs to trust the POS mechanism
2. Payer needs to trust the seller
3. Settlement must be fast
4. Seller should guarantee their product
5. Seller should reward customers who pay via crypto

## Advantages

I can say the best advantage of using Crypto Commerce is reducing taxes. Second, most cryptocurrencies have investment potential. Although sellers can receive stablecoins like USDT, receiving crypto such as BTC or ETH could have long-term benefits.

## POV: Customers
Why should someone trust sellers who only accept crypto? While fiat gives all the rights to the buyer, crypto gives rights to the receiver. In this case, the seller has a tough time building trust.

I think the best way to create a culture of paying via crypto requires following steps:

- **Rewarding crypto payers**: If we are selling our products via cryptocurrencies to reduce taxes, it's fair to share some of this savings with the buyer. For example, if you sell your product for $100 and typically pay 13% tax ($13), you should sell it for around $93.50 when accepting crypto. This way, both you and the buyer benefit, splitting the savings: $6.50 for you and $6.50 for the buyer who trusted you. A win-win situation. 

- Start Small: teach your customers that paying via crypto is safe, let them pay via crypto coins. reward them. give them the feeling they are pioneer of new modern era of money and currency. but this experience should be risk-free. start with very cheapest products. repeat this type of experience for your customer.

- Provide Guarantee and Alternatives: Offer all legal information to your customers, show them who you are, and maintain a trustworthy site. Join trust-building platforms, release videos, and present yourself on social media. Take all necessary steps to build trust. Start accepting crypto as an alternative payment method with rewards. Offer PayPal or other traditional forms of payment, so customers feel free to choose their preferred payment method. Never force them to choose cryptocurrency.
Dr. Stephen Nkem Asek Awarded Doctor Of Social Sciences (Honoris Causa) By AUBSS And QAHE
Tags: news, education, top, aubss
Published: 2024-06-14 17:25:41


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oz4no5gs14atyscf9lc6.jpg)

The American University of Business and Social Sciences (AUBSS) and the International Association for Quality Assurance in Pre-Tertiary and Higher Education (QAHE) are delighted to announce that Stephen Nkem Asek has been honored with the prestigious Doctor of Social Sciences (Honoris Causa) degree.

 

Mr. Asek, a highly accomplished professional with over 17 years of experience in the development and humanitarian fields, has made significant contributions to peacebuilding, conflict analysis, and the promotion of social cohesion. He has demonstrated exceptional leadership and expertise throughout his career, particularly in fragile and conflict-affected settings.

 

The Doctor of Social Sciences (Honoris Causa) award recognizes Mr. Asek’s outstanding achievements and his unwavering commitment to advancing social change and conflict resolution. His expertise in conflict sensitivity, mediation, and social behavioral change interventions has had a transformative impact on communities and organizations globally.

 

In addition to his remarkable professional accomplishments, Mr. Asek holds a wealth of educational qualifications, including an MSc in Education for Sustainability, a BSc in Political Science, and a Diploma in Resilient Markets: Market Systems Development for Fragile and Conflict-Affected Settings (FCAS). He has also received certifications in project management, dialogue and mediation, and various UN trainings on safety, ethics, and prevention of sexual harassment and abuse.

 

The conferment of the Doctor of Social Sciences (Honoris Causa) upon Mr. Asek is a testament to his exemplary contributions to the field and his dedication to promoting peace and sustainable development. AUBSS takes immense pride in recognizing Mr. Asek’s remarkable achievements and looks forward to his continued endeavors in creating positive social impact.

 

About AUBSS:

The American University of Business and Social Sciences (AUBSS) is a renowned institution committed to providing high-quality education in the fields of business and social sciences. AUBSS offers a range of programs designed to equip students with the knowledge and skills necessary to excel in their chosen careers.
Create a API Gateway using Ocelot
Tags: apigateway, ocelot, dotnet, csharp
Published: 2024-06-14 17:10:30

Hello guys!
Today I challenged myself to learn a little bit about Api Gateway, so I created one in my project using Ocelot.

## What is an API Gateway?
An API gateway is a server that acts as an intermediary between clients and backend services. It functions as a reverse proxy to accept all application programming interface (API) calls, aggregate the various services required to fulfill them, and return the appropriate result.

## What is Ocelot?
Ocelot is an open-source API Gateway built on the .NET platform. It is designed to manage and secure the flow of traffic between clients and backend services, particularly in microservices architectures. Ocelot provides a range of features to facilitate the handling of API requests and responses.

## How to create an API Gateway using Ocelot step by step?

## Step 1
**First of all, you need to set up 2 different API's**, in my project I created an UsersAPI and an EventsAPI
I have the following endpoints for the 2 controllers:
- https://localhost:7235/Events
- https://localhost:7239/Users

## Step 2
Next you'll need to create a new api for the gateway, and do not add any controller.

## Step 3
Add the Ocelot package to your gateway api.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4xmrzucgjscs6vqieu7.png)

## Step 4
Create a file named **ocelot.json** in your gateway api.
Here's mine:

```
{
  "Routes": [
    {
      "DownstreamPathTemplate": "/users/{everything}",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 7239
        }
      ],
      "UpstreamPathTemplate": "/api/users/{everything}",
      "UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ]
    },
    {
      "DownstreamPathTemplate": "/events/{everything}",
      "DownstreamScheme": "https",
      "DownstreamHostAndPorts": [
        {
          "Host": "localhost",
          "Port": 7235
        }
      ],
      "UpstreamPathTemplate": "/api/events/{everything}",
      "UpstreamHttpMethod": [ "GET", "POST", "PUT", "DELETE" ]
    }
  ],
  "GlobalConfiguration": {
    "BaseUrl": "https://localhost:7174"
  }
}

```

- In the GlobalConfiguration section, the BaseUrl is the URL of the API Gateway. When running the API Gateway it will run on this base URL and the users will interact with this URL.
- The UpStreamPathTemplate section represents the API Gateway endpoint, this will be the public endpoint for the users to ping.
- The DownStreamTemplate section represents the APIs endpoints.

By the above configuration, when you hit the endpoint http://localhost:7174/api/events, it will be redirected to API endpoint http://localhost:7235/Events

## Step 5
In your program.cs file, add the following:

```
builder.Configuration.AddJsonFile("ocelot.json", optional: false, reloadOnChange: true);

builder.Services.AddOcelot(builder.Configuration);

app.UseOcelot();
```

## Step 6
Try yourself and enjoy!

And that's it guys, a simple use case of using an api gateway with ocelot. I hope you liked it, stay tuned for more!
How much does hourly SEO Copywriting cost in European Countries?
Tags: eu, seo, copywriting, contentwriting
Published: 2024-06-14 17:08:00

In European Regions like the Netherlands including Eastern Europe, 

In Western Europe, Northern Europe, and Southern European countries (EU) average SEO Copywriting Cost by hour (remote, freelance) starts from € 30, € 70, and € 100.

And, the mentioned above SEO Copywriting (English) rate differs (increase and digress) due to:

- SEO Copywriter's SEO Copywriting Skillsets.
- SEO Copywriting Content's Length.
- Vary for content niches (keywords competitions).
- Freelance remote Copywriting Professionals GEO location.
- SEO Copywriter year of experience in Copywriting and SEO Copywriting Projects Completion.

Okay, Let me explain [How much hourly SEO Copywriting costs in European Countries, like the Netherlands](https://www.seosiri.com/2021/12/seo-copywriting-cost-in-eu.html).

#seocopywriting #copywriting #seo
How To Install Next js and set up Visual Studio Code (VS Code)
Tags: tutorial, nextjs, vscode, typescript
Published: 2024-06-14 17:06:36

{% embed https://youtu.be/Xsac_H9d2OM %}

Learn how to install Next.js and set up Visual Studio Code (VS Code) for a seamless development experience. 

In this tutorial, we cover everything from installing Next.js to configuring VS Code with the best extensions and settings for Next.js development. Whether you're a beginner or an experienced developer, this step-by-step guide will help you get started quickly and efficiently.