Using a clean and dry work surface, place the flour in a mound, creating a hole in the center. Add a teaspoon of salt and a little lukewarm water. Knead the dough until it is firm and elastic . At this point, make another hole and add the egg. With a rolling pin, stretch the dough; fold it in two, roll it again.
Repeat this process of thinning the dough and fold for eight consecutive times. At this point, the dough can be rolled out and cut into strips the size of spaghetti. Alternatively, the dough can be inserted into a potato masher or meat grinder (without the blade) and extruded into the designed shape and length. (In Veneto, such a device is called a Bigola, made for this purpose.) Allow the pasta to dry for about an hour.
For the sauce:
Rinse the anchovies in cold water, removing any remaining bones with your fingers. Coarsely chop them and set aside.
Heat the oil in a large skillet over medium heat. Add the onions and cook for about 10-15 minutes, adding 1-2 tablespoons of water until they become soft. Add the anchovies and stir carefully until they dissolve completely. Add salt and pepper to taste. Cook the mixture until the onions are golden.
Meanwhile, bring a large pot of salted water to a boil. Cook the pasta until al dente. Drain it and add to the skillet with the sauce. Mix well and serve immediately.